source: NonGTP/Xerces/xerces/include/xercesc/util/AutoSense.hpp @ 358

Revision 358, 10.2 KB checked in by bittner, 19 years ago (diff)

xerces added

Line 
1/*
2 * Copyright 1999-2002,2004 The Apache Software Foundation.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/*
18 * $Log: AutoSense.hpp,v $
19 * Revision 1.15  2004/09/08 13:56:21  peiyongz
20 * Apache License Version 2.0
21 *
22 * Revision 1.14  2004/02/17 15:56:50  neilg
23 * fix for bug 25035; much thanks to Abe Backus
24 *
25 * Revision 1.13  2004/02/04 13:26:44  amassari
26 * Added support for the Interix platform (Windows Services for Unix 3.5)
27 *
28 * Revision 1.12  2003/05/21 21:08:04  knoaman
29 * gcc 2.95.x is generating an internal error for some template definitions, so
30 * we use the default memory manger in such cases.
31 *
32 * Revision 1.11  2003/05/12 09:44:19  gareth
33 * Port to NetBSD. Patch by Hiramatsu Yoshifumi.
34 *
35 * Revision 1.10  2003/03/27 16:16:43  tng
36 * use __IBMCPP__ instead of __xlC__ to determine xlC compiler
37 *
38 * Revision 1.9  2003/03/13 22:11:46  tng
39 * [Bug 17858] Support for QNX/Neutrino.  Patch from Chris McKillop.
40 *
41 * Revision 1.8  2002/12/02 20:40:49  tng
42 * [Bug 12490] Patches required to build Xerces-C++ on BeOS R5.  Patch from Andrew Bachmann.
43 *
44 * Revision 1.7  2002/10/29 18:58:33  tng
45 * Support for Linux/390
46 *
47 * Revision 1.6  2002/08/23 20:56:00  tng
48 * [Bug 11981] inproper "AND" operator in AutoSense.hpp.
49 *
50 * Revision 1.5  2002/08/19 18:35:56  tng
51 * [Bug 6467] Installing Xerces C++ on cygwin environment.
52 *
53 * Revision 1.4  2002/07/12 16:48:49  jberry
54 * Remove reliance on XML_MACOSX. XML_MACOS is used solely. Where qualification
55 * by compiler is required, look for the compiler explicitly such as with
56 * XML_METROWERKS or __APPLE__ (for the Apple GCC compiler).
57 *
58 * Add a few tweaks for compatibility with GCC3.1.
59 *
60 * This change may address Bug 10649.
61 *
62 * Revision 1.3  2002/03/04 20:31:14  tng
63 * [Bug 2868] AIX 4.3.3 mutex/atomic-operation changes for build.
64 *
65 * Revision 1.2  2002/02/27 22:38:34  peiyongz
66 * Bug# 6445 Caldera (SCO) OpenServer Port : patch from Martin Kalen
67 *
68 * Revision 1.1.1.1  2002/02/01 22:22:09  peiyongz
69 * sane_include
70 *
71 * Revision 1.21  2001/11/29 18:25:18  tng
72 * FreeBSD support by Michael Huedepohl.
73 *
74 * Revision 1.20  2001/05/11 13:26:26  tng
75 * Copyright update.
76 *
77 * Revision 1.19  2001/03/23 19:01:25  tng
78 * [Bug 1018]  AutoSense looks for "IRIX" when it should look for "sgi" or "__sgi".  By Jeff Harrell.
79 *
80 * Revision 1.18  2001/02/09 14:40:01  tng
81 * Update support for SCO UnixWare 7 (gcc).  Tested under UnixWare 7.1.1 with gcc version 2.95.2 19991024 (release) with gmake 3.79.1.  Updated by Martin Kalen.
82 *
83 * Revision 1.17  2001/01/26 21:59:25  tng
84 * Change bug-todo list to xml format.  Other documentation fixes.
85 *
86 * Revision 1.16  2000/10/09 18:15:43  jberry
87 * Modify sensing of Mac OS X.
88 * PR:
89 * Obtained from:
90 * Submitted by:
91 * Reviewed by:
92 * PR:
93 * Obtained from:
94 * Submitted by:
95 * Reviewed by:
96 *
97 * Revision 1.15  2000/09/21 00:54:18  aruna1
98 * OS2 related changes given by Bill Schindler
99 *
100 * Revision 1.14  2000/08/01 18:26:02  aruna1
101 * Tru64 support added
102 *
103 * Revision 1.13  2000/07/18 18:25:58  andyh
104 * Mac OS update.
105 * Contributed by James Berry <jberry@criticalpath.com>
106 *
107 * Revision 1.12  2000/04/04 20:11:29  abagchi
108 * Added PTX support
109 *
110 * Revision 1.11  2000/03/02 19:54:37  roddey
111 * This checkin includes many changes done while waiting for the
112 * 1.1.0 code to be finished. I can't list them all here, but a list is
113 * available elsewhere.
114 *
115 * Revision 1.10  2000/03/02 01:51:00  aruna1
116 * Sun CC 5.0 related changes
117 *
118 * Revision 1.9  2000/02/24 20:05:23  abagchi
119 * Swat for removing Log from API docs
120 *
121 * Revision 1.8  2000/02/22 01:00:10  aruna1
122 * GNUGDefs references removed. Now only GCCDefs is used instead
123 *
124 * Revision 1.7  2000/02/06 07:48:00  rahulj
125 * Year 2K copyright swat.
126 *
127 * Revision 1.6  2000/02/01 23:43:22  abagchi
128 * AS/400 related change
129 *
130 * Revision 1.5  2000/01/21 22:12:29  abagchi
131 * OS390 Change: changed OE390 to OS390
132 *
133 * Revision 1.4  1999/12/18 00:47:01  rahulj
134 * Merged in some changes for OS390.
135 *
136 * Revision 1.3  1999/12/17 01:28:53  rahulj
137 * Merged in changes submitted for UnixWare 7 port. Platform
138 * specific files are still missing.
139 *
140 * Revision 1.2  1999/12/01 17:16:16  rahulj
141 * Added support for IRIX 6.5.5 using SGI MIPSpro C++ 7.3 and 7.21 generating 32 bit objects. Changes submitted by Marc Stuessel
142 *
143 * Revision 1.1.1.1  1999/11/09 01:03:55  twl
144 * Initial checkin
145 *
146 * Revision 1.2  1999/11/08 20:45:03  rahul
147 * Swat for adding in Product name and CVS comment log variable.
148 *
149 */
150
151#ifndef AUTOSENSE_HPP
152#define AUTOSENSE_HPP
153
154// ---------------------------------------------------------------------------
155//  This section attempts to auto detect the operating system. It will set
156//  up XercesC specific defines that are used by the rest of the code.
157// ---------------------------------------------------------------------------
158#if defined(_AIX)
159    #define XML_AIX
160    #define XML_UNIX
161    #if defined(_AIXVERSION_430)
162        #define XML_AIX43  // for use of POSIX compliant pthread functions
163    #endif
164#elif defined(_SEQUENT_)
165    #define XML_PTX
166    #define XML_UNIX
167#elif defined(_HP_UX) || defined(__hpux) || defined(_HPUX_SOURCE)
168    #define XML_HPUX
169    #define XML_UNIX
170#elif defined(SOLARIS) || defined(__SVR4)
171    #define XML_SOLARIS
172    #define XML_UNIX
173#elif defined(_SCO_DS)
174    #define XML_OPENSERVER
175    #define XML_UNIX
176#elif defined(__UNIXWARE__) || defined(__USLC__)
177    #define XML_UNIXWARE
178    #define XML_UNIX
179#elif defined(__BEOS__)
180    #define XML_BEOS
181    #define XML_UNIX
182#elif defined(__QNXNTO__)
183    #define XML_QNX
184    #define XML_UNIX
185#elif defined(__linux__)
186    #define XML_LINUX
187    #define XML_UNIX
188    #if defined(__s390__)
189        #define XML_LINUX_390
190    #endif
191#elif defined(__FreeBSD__)
192    #define XML_FREEBSD
193    #define XML_UNIX
194#elif defined(IRIX) || defined(__sgi)
195    #define XML_IRIX
196    #define XML_UNIX
197#elif defined(__MVS__)
198    #define XML_OS390
199    #define XML_UNIX
200#elif defined(EXM_OS390)
201    #define XML_OS390
202    #define XML_UNIX
203#elif defined(__OS400__)
204    #define XML_AS400
205    #define XML_UNIX
206#elif defined(__OS2__)
207    #define XML_OS2
208#elif defined(__TANDEM)
209    #define XML_TANDEM
210    #define XML_UNIX
211    #define XML_CSET
212#elif defined(__CYGWIN__)
213    #define XML_CYGWIN
214    #ifndef WIN32
215      #define WIN32
216    #endif
217#elif defined(_WIN32) || defined(WIN32)
218    #define XML_WIN32
219    #ifndef WIN32
220      #define WIN32
221    #endif
222#elif defined(__WINDOWS__)
223
224    // IBM VisualAge special handling
225    #if defined(__32BIT__)
226        #define XML_WIN32
227    #else
228        #define XML_WIN16
229    #endif
230#elif defined(__MSDXML__)
231    #define XML_DOS
232
233#elif defined(macintosh) || (defined(__APPLE__) && defined(__MACH__))
234    #define XML_MACOS
235#elif defined(__alpha) && defined(__osf__)
236    #define XML_TRU64
237#elif defined(__NetBSD__)
238    #define XML_NETBSD
239#elif defined(__INTERIX)
240    #define XML_INTERIX
241    #define XML_UNIX
242#else
243    #error Code requires port to host OS!
244#endif
245
246
247// ---------------------------------------------------------------------------
248//  This section attempts to autodetect the compiler being used. It will set
249//  up Xerces specific defines that can be used by the rest of the code.
250// ---------------------------------------------------------------------------
251#if defined(__BORLANDC__)
252    #define XML_BORLAND
253#elif defined(_MSC_VER)
254    #define XML_VISUALCPP
255#elif defined(XML_SOLARIS)
256    #if defined(__SUNPRO_CC) && (__SUNPRO_CC >=0x500)
257        #define XML_SUNCC5
258        #elif defined(__SUNPRO_CC) && (__SUNPRO_CC <0x500)
259        #define XML_SUNCC
260    #elif defined(_EDG_RUNTIME_USES_NAMESPACES)
261        #define XML_SOLARIS_KAICC
262    #elif defined(__GNUG__)
263                #define XML_GCC
264    #else
265        #error Code requires port to current development environment
266    #endif
267#elif defined (__QNXNTO__)
268    #define XML_QCC
269#elif defined (__GNUG__) || defined(__BEOS__) || defined(__linux__) || defined(__CYGWIN__)
270    #define XML_GCC
271#elif defined(XML_HPUX)
272    #if defined(EXM_HPUX)
273        #define XML_HPUX_KAICC
274    #elif (__cplusplus == 1)
275        #define XML_HPUX_CC
276    #elif (__cplusplus == 199707 || __cplusplus == 199711)
277        #define XML_HPUX_aCC
278    #endif
279#elif defined(XML_IRIX)
280    #define XML_MIPSPRO_CC
281#elif defined(XML_PTX)
282    #define XML_PTX_CC
283#elif defined(XML_TANDEM)
284    #define XML_TANDEMCC
285#elif defined(__MVS__) && defined(__cplusplus)
286    #define XML_MVSCPP
287#elif defined(EXM_OS390) && defined(__cplusplus)
288    #define XML_MVSCPP
289#elif defined(__IBMC__) || defined(__IBMCPP__)
290    #if defined(XML_WIN32)
291        #define XML_IBMVAW32
292    #elif defined(XML_OS2)
293        #define XML_IBMVAOS2
294        #if (__IBMC__ >= 400 || __IBMCPP__ >= 400)
295            #define XML_IBMVA4_OS2
296        #endif
297    #elif defined(XML_AIX)
298        #define XML_CSET             
299    #endif
300#elif defined(XML_TRU64) && defined(__DECCXX)
301    #define XML_DECCXX
302#elif defined(__MWERKS__)
303    #define XML_METROWERKS
304#elif defined(__OS400__)
305#else
306    #error Code requires port to current development environment
307#endif
308
309// ---------------------------------------------------------------------------
310//  The gcc compiler 2.95... is generating an internal error for some template
311//  definitions. So, if we are compiling with gcc, have a specific define that
312//  we can later use in the code.
313// ---------------------------------------------------------------------------
314#if defined(__GNUC__)
315#define XML_GCC_VERSION (__GNUC__ * 10000 \
316                         + __GNUC_MINOR__ * 100 \
317                         + __GNUC_PATCHLEVEL__)
318#endif
319
320
321#endif
Note: See TracBrowser for help on using the repository browser.