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