source: NonGTP/Xerces/xerces-c_2_8_0/include/xercesc/util/AutoSense.hpp @ 2674

Revision 2674, 6.0 KB checked in by mattausch, 16 years ago (diff)
Line 
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: AutoSense.hpp 568078 2007-08-21 11:43:25Z amassari $
20 */
21
22#ifndef AUTOSENSE_HPP
23#define AUTOSENSE_HPP
24
25// ---------------------------------------------------------------------------
26//  This section attempts to auto detect the operating system. It will set
27//  up XercesC specific defines that are used by the rest of the code.
28// ---------------------------------------------------------------------------
29#if defined(_AIX)
30    #define XML_AIX
31    #define XML_UNIX
32    #if defined(_AIXVERSION_430)
33        #define XML_AIX43  // for use of POSIX compliant pthread functions
34    #endif
35#elif defined(_SEQUENT_)
36    #define XML_PTX
37    #define XML_UNIX
38#elif defined(_HP_UX) || defined(__hpux) || defined(_HPUX_SOURCE)
39    #define XML_HPUX
40    #define XML_UNIX
41#elif defined(SOLARIS) || defined(__SVR4)
42    #define XML_SOLARIS
43    #define XML_UNIX
44#elif defined(_SCO_DS)
45    #define XML_OPENSERVER
46    #define XML_UNIX
47#elif defined(__UNIXWARE__) || defined(__USLC__)
48    #define XML_UNIXWARE
49    #define XML_UNIX
50#elif defined(__BEOS__)
51    #define XML_BEOS
52    #define XML_UNIX
53#elif defined(__QNXNTO__)
54    #define XML_QNX
55    #define XML_UNIX
56#elif defined(__linux__)
57    #define XML_LINUX
58    #define XML_UNIX
59    #if defined(__s390__)
60        #define XML_LINUX_390
61    #endif
62#elif defined(__FreeBSD__)
63    #define XML_FREEBSD
64    #define XML_UNIX
65#elif defined(IRIX) || defined(__sgi)
66    #define XML_IRIX
67    #define XML_UNIX
68#elif defined(__MVS__)
69    #define XML_OS390
70    #define XML_UNIX
71#elif defined(EXM_OS390)
72    #define XML_OS390
73    #define XML_UNIX
74#elif defined(__OS400__)
75    #define XML_AS400
76    #define XML_UNIX
77#elif defined(__OS2__)
78    #define XML_OS2
79#elif defined(__TANDEM)
80    #define XML_TANDEM
81    #define XML_UNIX
82    #define XML_CSET
83#elif defined(__CYGWIN__)
84    #define XML_CYGWIN
85    #ifndef WIN32
86      #define WIN32
87    #endif
88#elif defined(_WIN32) || defined(WIN32)
89    #define XML_WIN32
90    #ifndef WIN32
91      #define WIN32
92    #endif
93#elif defined(__WINDOWS__)
94
95    // IBM VisualAge special handling
96    #if defined(__32BIT__)
97        #define XML_WIN32
98    #else
99        #define XML_WIN16
100    #endif
101#elif defined(__MSDXML__)
102    #define XML_DOS
103
104#elif defined(macintosh) || (defined(__APPLE__) && defined(__MACH__))
105    #define XML_MACOS
106#elif defined(__alpha) && defined(__osf__)
107    #define XML_TRU64
108#elif defined(__NetBSD__)
109    #define XML_NETBSD
110#elif defined(__INTERIX)
111    #define XML_INTERIX
112    #define XML_UNIX
113#else
114    #error Code requires port to host OS!
115#endif
116
117
118// ---------------------------------------------------------------------------
119//  This section attempts to autodetect the compiler being used. It will set
120//  up Xerces specific defines that can be used by the rest of the code.
121// ---------------------------------------------------------------------------
122#if defined(__BORLANDC__)
123    #define XML_BORLAND
124#elif defined(_MSC_VER)
125    #define XML_VISUALCPP
126#elif defined(XML_SOLARIS)
127    #if defined(__SUNPRO_CC) && (__SUNPRO_CC >=0x500)
128        #define XML_SUNCC5
129        #elif defined(__SUNPRO_CC) && (__SUNPRO_CC <0x500)
130        #define XML_SUNCC
131    #elif defined(_EDG_RUNTIME_USES_NAMESPACES)
132        #define XML_SOLARIS_KAICC
133    #elif defined(__GNUG__)
134                #define XML_GCC
135    #else
136        #error Code requires port to current development environment
137    #endif
138#elif defined (__QNXNTO__)
139    #define XML_QCC
140#elif defined(__IBMC__) || defined(__IBMCPP__)
141    #if defined(XML_WIN32)
142        #define XML_IBMVAW32
143    #elif defined(XML_OS2)
144        #define XML_IBMVAOS2
145        #if (__IBMC__ >= 400 || __IBMCPP__ >= 400)
146            #define XML_IBMVA4_OS2
147        #endif
148    #elif defined(XML_AIX) || defined(__linux__)
149        #define XML_CSET             
150    #elif defined(__MVS__) && defined(__cplusplus)
151        #define XML_MVSCPP
152    #elif defined(EXM_OS390) && defined(__cplusplus)
153        #define XML_MVSCPP
154    #endif
155#elif defined (__GNUG__) || defined(__BEOS__) || defined(__linux__) || defined(__CYGWIN__)
156    #define XML_GCC
157#elif defined(XML_HPUX)
158    #if defined(EXM_HPUX)
159        #define XML_HPUX_KAICC
160    #elif (__cplusplus == 1)
161        #define XML_HPUX_CC
162    #elif (__cplusplus == 199707 || __cplusplus == 199711)
163        #define XML_HPUX_aCC
164    #endif
165#elif defined(XML_IRIX)
166    #define XML_MIPSPRO_CC
167#elif defined(XML_PTX)
168    #define XML_PTX_CC
169#elif defined(XML_TANDEM)
170    #define XML_TANDEMCC
171#elif defined(__MVS__) && defined(__cplusplus)
172    #define XML_MVSCPP
173#elif defined(EXM_OS390) && defined(__cplusplus)
174    #define XML_MVSCPP
175#elif defined(XML_TRU64) && defined(__DECCXX)
176    #define XML_DECCXX
177#elif defined(__MWERKS__)
178    #define XML_METROWERKS
179#elif defined(__OS400__)
180#elif defined(XML_UNIXWARE)
181    #define XML_SCOCC
182#else
183    #error Code requires port to current development environment
184#endif
185
186// ---------------------------------------------------------------------------
187//  The gcc compiler 2.95... is generating an internal error for some template
188//  definitions. So, if we are compiling with gcc, have a specific define that
189//  we can later use in the code.
190// ---------------------------------------------------------------------------
191#if defined(__GNUC__)
192#define XML_GCC_VERSION (__GNUC__ * 10000 \
193                         + __GNUC_MINOR__ * 100 \
194                         + __GNUC_PATCHLEVEL__)
195#endif
196
197
198#endif
Note: See TracBrowser for help on using the repository browser.