source: NonGTP/Xerces/xercesc/util/AutoSense.hpp @ 188

Revision 188, 12.0 KB checked in by mattausch, 19 years ago (diff)

added xercesc to support

Line 
1/*
2 * The Apache Software License, Version 1.1
3 *
4 * Copyright (c) 1999-2002 The Apache Software Foundation.  All rights
5 * reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * 1. Redistributions of source code must retain the above copyright
12 *    notice, this list of conditions and the following disclaimer.
13 *
14 * 2. Redistributions in binary form must reproduce the above copyright
15 *    notice, this list of conditions and the following disclaimer in
16 *    the documentation and/or other materials provided with the
17 *    distribution.
18 *
19 * 3. The end-user documentation included with the redistribution,
20 *    if any, must include the following acknowledgment:
21 *       "This product includes software developed by the
22 *        Apache Software Foundation (http://www.apache.org/)."
23 *    Alternately, this acknowledgment may appear in the software itself,
24 *    if and wherever such third-party acknowledgments normally appear.
25 *
26 * 4. The names "Xerces" and "Apache Software Foundation" must
27 *    not be used to endorse or promote products derived from this
28 *    software without prior written permission. For written
29 *    permission, please contact apache\@apache.org.
30 *
31 * 5. Products derived from this software may not be called "Apache",
32 *    nor may "Apache" appear in their name, without prior written
33 *    permission of the Apache Software Foundation.
34 *
35 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
36 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
37 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
38 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
39 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
40 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
41 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
42 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
43 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
44 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
45 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
46 * SUCH DAMAGE.
47 * ====================================================================
48 *
49 * This software consists of voluntary contributions made by many
50 * individuals on behalf of the Apache Software Foundation, and was
51 * originally based on software copyright (c) 1999, International
52 * Business Machines, Inc., http://www.ibm.com .  For more information
53 * on the Apache Software Foundation, please see
54 * <http://www.apache.org/>.
55 */
56
57/*
58 * $Log: AutoSense.hpp,v $
59 * Revision 1.13  2004/02/04 13:26:44  amassari
60 * Added support for the Interix platform (Windows Services for Unix 3.5)
61 *
62 * Revision 1.12  2003/05/21 21:08:04  knoaman
63 * gcc 2.95.x is generating an internal error for some template definitions, so
64 * we use the default memory manger in such cases.
65 *
66 * Revision 1.11  2003/05/12 09:44:19  gareth
67 * Port to NetBSD. Patch by Hiramatsu Yoshifumi.
68 *
69 * Revision 1.10  2003/03/27 16:16:43  tng
70 * use __IBMCPP__ instead of __xlC__ to determine xlC compiler
71 *
72 * Revision 1.9  2003/03/13 22:11:46  tng
73 * [Bug 17858] Support for QNX/Neutrino.  Patch from Chris McKillop.
74 *
75 * Revision 1.8  2002/12/02 20:40:49  tng
76 * [Bug 12490] Patches required to build Xerces-C++ on BeOS R5.  Patch from Andrew Bachmann.
77 *
78 * Revision 1.7  2002/10/29 18:58:33  tng
79 * Support for Linux/390
80 *
81 * Revision 1.6  2002/08/23 20:56:00  tng
82 * [Bug 11981] inproper "AND" operator in AutoSense.hpp.
83 *
84 * Revision 1.5  2002/08/19 18:35:56  tng
85 * [Bug 6467] Installing Xerces C++ on cygwin environment.
86 *
87 * Revision 1.4  2002/07/12 16:48:49  jberry
88 * Remove reliance on XML_MACOSX. XML_MACOS is used solely. Where qualification
89 * by compiler is required, look for the compiler explicitly such as with
90 * XML_METROWERKS or __APPLE__ (for the Apple GCC compiler).
91 *
92 * Add a few tweaks for compatibility with GCC3.1.
93 *
94 * This change may address Bug 10649.
95 *
96 * Revision 1.3  2002/03/04 20:31:14  tng
97 * [Bug 2868] AIX 4.3.3 mutex/atomic-operation changes for build.
98 *
99 * Revision 1.2  2002/02/27 22:38:34  peiyongz
100 * Bug# 6445 Caldera (SCO) OpenServer Port : patch from Martin Kalen
101 *
102 * Revision 1.1.1.1  2002/02/01 22:22:09  peiyongz
103 * sane_include
104 *
105 * Revision 1.21  2001/11/29 18:25:18  tng
106 * FreeBSD support by Michael Huedepohl.
107 *
108 * Revision 1.20  2001/05/11 13:26:26  tng
109 * Copyright update.
110 *
111 * Revision 1.19  2001/03/23 19:01:25  tng
112 * [Bug 1018]  AutoSense looks for "IRIX" when it should look for "sgi" or "__sgi".  By Jeff Harrell.
113 *
114 * Revision 1.18  2001/02/09 14:40:01  tng
115 * 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.
116 *
117 * Revision 1.17  2001/01/26 21:59:25  tng
118 * Change bug-todo list to xml format.  Other documentation fixes.
119 *
120 * Revision 1.16  2000/10/09 18:15:43  jberry
121 * Modify sensing of Mac OS X.
122 * PR:
123 * Obtained from:
124 * Submitted by:
125 * Reviewed by:
126 * PR:
127 * Obtained from:
128 * Submitted by:
129 * Reviewed by:
130 *
131 * Revision 1.15  2000/09/21 00:54:18  aruna1
132 * OS2 related changes given by Bill Schindler
133 *
134 * Revision 1.14  2000/08/01 18:26:02  aruna1
135 * Tru64 support added
136 *
137 * Revision 1.13  2000/07/18 18:25:58  andyh
138 * Mac OS update.
139 * Contributed by James Berry <jberry@criticalpath.com>
140 *
141 * Revision 1.12  2000/04/04 20:11:29  abagchi
142 * Added PTX support
143 *
144 * Revision 1.11  2000/03/02 19:54:37  roddey
145 * This checkin includes many changes done while waiting for the
146 * 1.1.0 code to be finished. I can't list them all here, but a list is
147 * available elsewhere.
148 *
149 * Revision 1.10  2000/03/02 01:51:00  aruna1
150 * Sun CC 5.0 related changes
151 *
152 * Revision 1.9  2000/02/24 20:05:23  abagchi
153 * Swat for removing Log from API docs
154 *
155 * Revision 1.8  2000/02/22 01:00:10  aruna1
156 * GNUGDefs references removed. Now only GCCDefs is used instead
157 *
158 * Revision 1.7  2000/02/06 07:48:00  rahulj
159 * Year 2K copyright swat.
160 *
161 * Revision 1.6  2000/02/01 23:43:22  abagchi
162 * AS/400 related change
163 *
164 * Revision 1.5  2000/01/21 22:12:29  abagchi
165 * OS390 Change: changed OE390 to OS390
166 *
167 * Revision 1.4  1999/12/18 00:47:01  rahulj
168 * Merged in some changes for OS390.
169 *
170 * Revision 1.3  1999/12/17 01:28:53  rahulj
171 * Merged in changes submitted for UnixWare 7 port. Platform
172 * specific files are still missing.
173 *
174 * Revision 1.2  1999/12/01 17:16:16  rahulj
175 * 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
176 *
177 * Revision 1.1.1.1  1999/11/09 01:03:55  twl
178 * Initial checkin
179 *
180 * Revision 1.2  1999/11/08 20:45:03  rahul
181 * Swat for adding in Product name and CVS comment log variable.
182 *
183 */
184
185#ifndef AUTOSENSE_HPP
186#define AUTOSENSE_HPP
187
188// ---------------------------------------------------------------------------
189//  This section attempts to auto detect the operating system. It will set
190//  up XercesC specific defines that are used by the rest of the code.
191// ---------------------------------------------------------------------------
192#if defined(_AIX)
193    #define XML_AIX
194    #define XML_UNIX
195    #if defined(_AIXVERSION_430)
196        #define XML_AIX43  // for use of POSIX compliant pthread functions
197    #endif
198#elif defined(_SEQUENT_)
199    #define XML_PTX
200    #define XML_UNIX
201#elif defined(_HP_UX) || defined(__hpux) || defined(_HPUX_SOURCE)
202    #define XML_HPUX
203    #define XML_UNIX
204#elif defined(SOLARIS) || defined(__SVR4)
205    #define XML_SOLARIS
206    #define XML_UNIX
207#elif defined(_SCO_DS)
208    #define XML_OPENSERVER
209    #define XML_UNIX
210#elif defined(__UNIXWARE__) || defined(__USLC__)
211    #define XML_UNIXWARE
212    #define XML_UNIX
213#elif defined(__BEOS__)
214    #define XML_BEOS
215    #define XML_UNIX
216#elif defined(__QNXNTO__)
217    #define XML_QNX
218    #define XML_UNIX
219#elif defined(__linux__)
220    #define XML_LINUX
221    #define XML_UNIX
222    #if defined(__s390__)
223        #define XML_LINUX_390
224    #endif
225#elif defined(__FreeBSD__)
226    #define XML_FREEBSD
227    #define XML_UNIX
228#elif defined(IRIX) || defined(__sgi)
229    #define XML_IRIX
230    #define XML_UNIX
231#elif defined(__MVS__)
232    #define XML_OS390
233    #define XML_UNIX
234#elif defined(EXM_OS390)
235    #define XML_OS390
236    #define XML_UNIX
237#elif defined(__OS400__)
238    #define XML_AS400
239    #define XML_UNIX
240#elif defined(__OS2__)
241    #define XML_OS2
242#elif defined(__TANDEM)
243    #define XML_TANDEM
244    #define XML_UNIX
245    #define XML_CSET
246#elif defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__)
247    #define XML_WIN32
248    #ifndef WIN32
249      #define WIN32
250    #endif
251#elif defined(__WINDOWS__)
252
253    // IBM VisualAge special handling
254    #if defined(__32BIT__)
255        #define XML_WIN32
256    #else
257        #define XML_WIN16
258    #endif
259#elif defined(__MSDXML__)
260    #define XML_DOS
261
262#elif defined(macintosh) || (defined(__APPLE__) && defined(__MACH__))
263    #define XML_MACOS
264#elif defined(__alpha) && defined(__osf__)
265    #define XML_TRU64
266#elif defined(__NetBSD__)
267    #define XML_NETBSD
268#elif defined(__INTERIX)
269    #define XML_INTERIX
270    #define XML_UNIX
271#else
272    #error Code requires port to host OS!
273#endif
274
275
276// ---------------------------------------------------------------------------
277//  This section attempts to autodetect the compiler being used. It will set
278//  up Xerces specific defines that can be used by the rest of the code.
279// ---------------------------------------------------------------------------
280#if defined(__BORLANDC__)
281    #define XML_BORLAND
282#elif defined(_MSC_VER)
283    #define XML_VISUALCPP
284#elif defined(XML_SOLARIS)
285    #if defined(__SUNPRO_CC) && (__SUNPRO_CC >=0x500)
286        #define XML_SUNCC5
287        #elif defined(__SUNPRO_CC) && (__SUNPRO_CC <0x500)
288        #define XML_SUNCC
289    #elif defined(_EDG_RUNTIME_USES_NAMESPACES)
290        #define XML_SOLARIS_KAICC
291    #elif defined(__GNUG__)
292                #define XML_GCC
293    #else
294        #error Code requires port to current development environment
295    #endif
296#elif defined (__QNXNTO__)
297    #define XML_QCC
298#elif defined (__GNUG__) || defined(__BEOS__) || defined(__linux__) || defined(__CYGWIN__)
299    #define XML_GCC
300#elif defined(XML_HPUX)
301    #if defined(EXM_HPUX)
302        #define XML_HPUX_KAICC
303    #elif (__cplusplus == 1)
304        #define XML_HPUX_CC
305    #elif (__cplusplus == 199707 || __cplusplus == 199711)
306        #define XML_HPUX_aCC
307    #endif
308#elif defined(XML_IRIX)
309    #define XML_MIPSPRO_CC
310#elif defined(XML_PTX)
311    #define XML_PTX_CC
312#elif defined(XML_TANDEM)
313    #define XML_TANDEMCC
314#elif defined(__MVS__) && defined(__cplusplus)
315    #define XML_MVSCPP
316#elif defined(EXM_OS390) && defined(__cplusplus)
317    #define XML_MVSCPP
318#elif defined(__IBMC__) || defined(__IBMCPP__)
319    #if defined(XML_WIN32)
320        #define XML_IBMVAW32
321    #elif defined(XML_OS2)
322        #define XML_IBMVAOS2
323        #if (__IBMC__ >= 400 || __IBMCPP__ >= 400)
324            #define XML_IBMVA4_OS2
325        #endif
326    #elif defined(XML_AIX)
327        #define XML_CSET             
328    #endif
329#elif defined(XML_TRU64) && defined(__DECCXX)
330    #define XML_DECCXX
331#elif defined(__MWERKS__)
332    #define XML_METROWERKS
333#elif defined(__OS400__)
334#else
335    #error Code requires port to current development environment
336#endif
337
338// ---------------------------------------------------------------------------
339//  The gcc compiler 2.95... is generating an internal error for some template
340//  definitions. So, if we are compiling with gcc, have a specific define that
341//  we can later use in the code.
342// ---------------------------------------------------------------------------
343#if defined(__GNUC__)
344#define XML_GCC_VERSION (__GNUC__ * 10000 \
345                         + __GNUC_MINOR__ * 100 \
346                         + __GNUC_PATCHLEVEL__)
347#endif
348
349
350#endif
Note: See TracBrowser for help on using the repository browser.