|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 /* |
|
18 * Licensed to the Apache Software Foundation (ASF) under one or more |
|
19 * contributor license agreements. See the NOTICE file distributed with |
|
20 * this work for additional information regarding copyright ownership. |
|
21 * The ASF licenses this file to You under the Apache License, Version 2.0 |
|
22 * (the "License"); you may not use this file except in compliance with |
|
23 * the License. You may obtain a copy of the License at |
|
24 * |
|
25 * http://www.apache.org/licenses/LICENSE-2.0 |
|
26 * |
|
27 * Unless required by applicable law or agreed to in writing, software |
|
28 * distributed under the License is distributed on an "AS IS" BASIS, |
|
29 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
30 * See the License for the specific language governing permissions and |
|
31 * limitations under the License. |
|
32 */ |
|
33 |
|
34 /* |
|
35 * $Id: XercesDefs.hpp 568078 2007-08-21 11:43:25Z amassari $ |
|
36 */ |
|
37 |
|
38 |
|
39 #if !defined(XERCESDEFS_HPP) |
|
40 #define XERCESDEFS_HPP |
|
41 |
|
42 // --------------------------------------------------------------------------- |
|
43 // Include the Xerces version information; this is kept in a separate file to |
|
44 // make modification simple and obvious. Updates to the version header file |
|
45 // --------------------------------------------------------------------------- |
|
46 #include <xercesc/util/XercesVersion.hpp> |
|
47 |
|
48 |
|
49 // --------------------------------------------------------------------------- |
|
50 // Include the header that does automatic sensing of the current platform |
|
51 // and compiler. |
|
52 // --------------------------------------------------------------------------- |
|
53 #include <xercesc/util/AutoSense.hpp> |
|
54 |
|
55 #define XERCES_Invalid_File_Handle 0 |
|
56 |
|
57 // --------------------------------------------------------------------------- |
|
58 // According to the platform we include a platform specific file. This guy |
|
59 // will set up any platform specific stuff, such as character mode. |
|
60 // --------------------------------------------------------------------------- |
|
61 #if defined(XML_WIN32) |
|
62 #include <xercesc/util/Platforms/Win32/Win32Defs.hpp> |
|
63 #endif |
|
64 |
|
65 #if defined(XML_CYGWIN) |
|
66 #include <xercesc/util/Platforms/Cygwin/CygwinDefs.hpp> |
|
67 #endif |
|
68 |
|
69 #if defined(XML_AIX) |
|
70 #include <xercesc/util/Platforms/AIX/AIXDefs.hpp> |
|
71 #endif |
|
72 |
|
73 #if defined(XML_SOLARIS) |
|
74 #include <xercesc/util/Platforms/Solaris/SolarisDefs.hpp> |
|
75 #endif |
|
76 |
|
77 #if defined(XML_OPENSERVER) |
|
78 #include <xercesc/util/Platforms/OpenServer/OpenServerDefs.hpp> |
|
79 #endif |
|
80 |
|
81 #if defined(XML_UNIXWARE) |
|
82 #include <xercesc/util/Platforms/UnixWare/UnixWareDefs.hpp> |
|
83 #endif |
|
84 |
|
85 #if defined(XML_HPUX) |
|
86 #include <xercesc/util/Platforms/HPUX/HPUXDefs.hpp> |
|
87 #endif |
|
88 |
|
89 #if defined(XML_IRIX) |
|
90 #include <xercesc/util/Platforms/IRIX/IRIXDefs.hpp> |
|
91 #endif |
|
92 |
|
93 #if defined(XML_INTERIX) |
|
94 #include <xercesc/util/Platforms/Interix/InterixDefs.hpp> |
|
95 #endif |
|
96 |
|
97 #if defined(XML_TANDEM) |
|
98 #include <xercesc/util/Platforms/Tandem/TandemDefs.hpp> |
|
99 #endif |
|
100 |
|
101 #if defined(XML_BEOS) |
|
102 #include <xercesc/util/Platforms/BeOS/BeOSDefs.hpp> |
|
103 #endif |
|
104 |
|
105 #if defined(XML_LINUX) |
|
106 #include <xercesc/util/Platforms/Linux/LinuxDefs.hpp> |
|
107 #endif |
|
108 |
|
109 #if defined(XML_FREEBSD) |
|
110 #include <xercesc/util/Platforms/FreeBSD/FreeBSDDefs.hpp> |
|
111 #endif |
|
112 |
|
113 #if defined(XML_OS390) |
|
114 #include <xercesc/util/Platforms/OS390/OS390Defs.hpp> |
|
115 #endif |
|
116 |
|
117 #if defined(XML_PTX) |
|
118 #include <xercesc/util/Platforms/PTX/PTXDefs.hpp> |
|
119 #endif |
|
120 |
|
121 #if defined(XML_OS2) |
|
122 #include <xercesc/util/Platforms/OS2/OS2Defs.hpp> |
|
123 #endif |
|
124 |
|
125 #if defined(XML_MACOS) |
|
126 #include <xercesc/util/Platforms/MacOS/MacOSDefs.hpp> |
|
127 #endif |
|
128 |
|
129 #if defined(XML_AS400) |
|
130 #include <xercesc/util/Platforms/OS400/OS400Defs.hpp> |
|
131 #endif |
|
132 |
|
133 #if defined(XML_TRU64) |
|
134 #include <xercesc/util/Platforms/Tru64/Tru64Defs.hpp> |
|
135 #endif |
|
136 |
|
137 #if defined(XML_QNX) |
|
138 #include <xercesc/util/Platforms/QNX/QNXDefs.hpp> |
|
139 #endif |
|
140 |
|
141 // --------------------------------------------------------------------------- |
|
142 // And now we subinclude a header according to the development environment |
|
143 // we are on. This guy defines for each platform some basic stuff that is |
|
144 // specific to the development environment. |
|
145 // --------------------------------------------------------------------------- |
|
146 #if defined(XML_VISUALCPP) |
|
147 #include <xercesc/util/Compilers/VCPPDefs.hpp> |
|
148 #endif |
|
149 |
|
150 #if defined(XML_CSET) |
|
151 #include <xercesc/util/Compilers/CSetDefs.hpp> |
|
152 #endif |
|
153 |
|
154 #if defined(XML_BORLAND) |
|
155 #include <xercesc/util/Compilers/BorlandCDefs.hpp> |
|
156 #endif |
|
157 |
|
158 #if defined(XML_SUNCC) || defined(XML_SUNCC5) |
|
159 #include <xercesc/util/Compilers/SunCCDefs.hpp> |
|
160 #endif |
|
161 |
|
162 #if defined(XML_SCOCC) |
|
163 #include <xercesc/util/Compilers/SCOCCDefs.hpp> |
|
164 #endif |
|
165 |
|
166 #if defined(XML_SOLARIS_KAICC) |
|
167 #include <xercesc/util/Compilers/SunKaiDefs.hpp> |
|
168 #endif |
|
169 |
|
170 #if defined(XML_HPUX_CC) || defined(XML_HPUX_aCC) || defined(XML_HPUX_KAICC) |
|
171 #include <xercesc/util/Compilers/HPCCDefs.hpp> |
|
172 #endif |
|
173 |
|
174 #if defined(XML_MIPSPRO_CC) |
|
175 #include <xercesc/util/Compilers/MIPSproDefs.hpp> |
|
176 #endif |
|
177 |
|
178 #if defined(XML_TANDEMCC) |
|
179 #include <xercesc/util/Compilers/TandemCCDefs.hpp> |
|
180 #endif |
|
181 |
|
182 #if defined(XML_GCC) |
|
183 #include <xercesc/util/Compilers/GCCDefs.hpp> |
|
184 #endif |
|
185 |
|
186 #if defined(XML_MVSCPP) |
|
187 #include <xercesc/util/Compilers/MVSCPPDefs.hpp> |
|
188 #endif |
|
189 |
|
190 #if defined(XML_IBMVAW32) |
|
191 #include <xercesc/util/Compilers/IBMVAW32Defs.hpp> |
|
192 #endif |
|
193 |
|
194 #if defined(XML_IBMVAOS2) |
|
195 #include <xercesc/util/Compilers/IBMVAOS2Defs.hpp> |
|
196 #endif |
|
197 |
|
198 #if defined(XML_METROWERKS) |
|
199 #include <xercesc/util/Compilers/CodeWarriorDefs.hpp> |
|
200 #endif |
|
201 |
|
202 #if defined(XML_PTX_CC) |
|
203 #include <xercesc/util/Compilers/PTXCCDefs.hpp> |
|
204 #endif |
|
205 |
|
206 #if defined(XML_AS400) |
|
207 #include <xercesc/util/Compilers/OS400SetDefs.hpp> |
|
208 #endif |
|
209 |
|
210 #if defined(XML_DECCXX) |
|
211 #include <xercesc/util/Compilers/DECCXXDefs.hpp> |
|
212 #endif |
|
213 |
|
214 #if defined(XML_QCC) |
|
215 #include <xercesc/util/Compilers/QCCDefs.hpp> |
|
216 #endif |
|
217 |
|
218 // --------------------------------------------------------------------------- |
|
219 // Some general typedefs that are defined for internal flexibility. |
|
220 // |
|
221 // Note that UTF16Ch is fixed at 16 bits, whereas XMLCh floats in size per |
|
222 // platform, to whatever is the native wide char format there. UCS4Ch is |
|
223 // fixed at 32 bits. The types we defined them in terms of are defined per |
|
224 // compiler, using whatever types are the right ones for them to get these |
|
225 // 16/32 bit sizes. |
|
226 // |
|
227 // --------------------------------------------------------------------------- |
|
228 typedef unsigned char XMLByte; |
|
229 typedef XMLUInt16 UTF16Ch; |
|
230 typedef XMLUInt32 UCS4Ch; |
|
231 |
|
232 |
|
233 // --------------------------------------------------------------------------- |
|
234 // Handle boolean. If the platform can handle booleans itself, then we |
|
235 // map our boolean type to the native type. Otherwise we create a default |
|
236 // one as an int and define const values for true and false. |
|
237 // |
|
238 // This flag will be set in the per-development environment stuff above. |
|
239 // --------------------------------------------------------------------------- |
|
240 #if defined(NO_NATIVE_BOOL) |
|
241 #ifndef bool |
|
242 typedef int bool; |
|
243 #endif |
|
244 #ifndef true |
|
245 #define true 1 |
|
246 #endif |
|
247 #ifndef false |
|
248 #define false 0 |
|
249 #endif |
|
250 #endif |
|
251 |
|
252 #if defined(XML_NETBSD) |
|
253 #include <xercesc/util/Platforms/NetBSD/NetBSDDefs.hpp> |
|
254 #endif |
|
255 |
|
256 // --------------------------------------------------------------------------- |
|
257 // According to whether the compiler suports L"" type strings, we define |
|
258 // the XMLStrL() macro one way or another. |
|
259 // --------------------------------------------------------------------------- |
|
260 #if defined(XML_LSTRSUPPORT) |
|
261 #define XMLStrL(str) L##str |
|
262 #else |
|
263 #define XMLStrL(str) str |
|
264 #endif |
|
265 |
|
266 |
|
267 // --------------------------------------------------------------------------- |
|
268 // Define namespace symbols if the compiler supports it. |
|
269 // --------------------------------------------------------------------------- |
|
270 #if defined(XERCES_HAS_CPP_NAMESPACE) |
|
271 #define XERCES_CPP_NAMESPACE_BEGIN namespace XERCES_CPP_NAMESPACE { |
|
272 #define XERCES_CPP_NAMESPACE_END } |
|
273 #define XERCES_CPP_NAMESPACE_USE using namespace XERCES_CPP_NAMESPACE; |
|
274 #define XERCES_CPP_NAMESPACE_QUALIFIER XERCES_CPP_NAMESPACE:: |
|
275 |
|
276 namespace XERCES_CPP_NAMESPACE { } |
|
277 namespace xercesc = XERCES_CPP_NAMESPACE; |
|
278 #else |
|
279 #define XERCES_CPP_NAMESPACE_BEGIN |
|
280 #define XERCES_CPP_NAMESPACE_END |
|
281 #define XERCES_CPP_NAMESPACE_USE |
|
282 #define XERCES_CPP_NAMESPACE_QUALIFIER |
|
283 #endif |
|
284 |
|
285 #if defined(XERCES_STD_NAMESPACE) |
|
286 #define XERCES_USING_STD(NAME) using std :: NAME; |
|
287 #define XERCES_STD_QUALIFIER std :: |
|
288 #else |
|
289 #define XERCES_USING_STD(NAME) |
|
290 #define XERCES_STD_QUALIFIER |
|
291 #endif |
|
292 |
|
293 |
|
294 // --------------------------------------------------------------------------- |
|
295 // Set up the import/export keyword for our core projects. The |
|
296 // PLATFORM_XXXX keywords are set in the per-development environment |
|
297 // include above. |
|
298 // --------------------------------------------------------------------------- |
|
299 #if defined(PROJ_XMLUTIL) |
|
300 #define XMLUTIL_EXPORT PLATFORM_EXPORT |
|
301 #else |
|
302 #define XMLUTIL_EXPORT PLATFORM_IMPORT |
|
303 #endif |
|
304 |
|
305 #if defined(PROJ_XMLPARSER) |
|
306 #define XMLPARSER_EXPORT PLATFORM_EXPORT |
|
307 #else |
|
308 #define XMLPARSER_EXPORT PLATFORM_IMPORT |
|
309 #endif |
|
310 |
|
311 #if defined(PROJ_SAX4C) |
|
312 #define SAX_EXPORT PLATFORM_EXPORT |
|
313 #else |
|
314 #define SAX_EXPORT PLATFORM_IMPORT |
|
315 #endif |
|
316 |
|
317 #if defined(PROJ_SAX2) |
|
318 #define SAX2_EXPORT PLATFORM_EXPORT |
|
319 #else |
|
320 #define SAX2_EXPORT PLATFORM_IMPORT |
|
321 #endif |
|
322 |
|
323 #if defined(PROJ_DOM) |
|
324 #define CDOM_EXPORT PLATFORM_EXPORT |
|
325 #else |
|
326 #define CDOM_EXPORT PLATFORM_IMPORT |
|
327 #endif |
|
328 |
|
329 #if defined(PROJ_DEPRECATED_DOM) |
|
330 #define DEPRECATED_DOM_EXPORT PLATFORM_EXPORT |
|
331 #else |
|
332 #define DEPRECATED_DOM_EXPORT PLATFORM_IMPORT |
|
333 #endif |
|
334 |
|
335 #if defined(PROJ_PARSERS) |
|
336 #define PARSERS_EXPORT PLATFORM_EXPORT |
|
337 #else |
|
338 #define PARSERS_EXPORT PLATFORM_IMPORT |
|
339 #endif |
|
340 |
|
341 #if defined(PROJ_VALIDATORS) |
|
342 #define VALIDATORS_EXPORT PLATFORM_EXPORT |
|
343 #else |
|
344 #define VALIDATORS_EXPORT PLATFORM_IMPORT |
|
345 #endif |
|
346 |
|
347 #endif |