]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/platform.h
3 * Purpose: define the OS and compiler identification macros
4 * Author: Vadim Zeitlin
6 * Created: 29.10.01 (extracted from wx/defs.h)
8 * Copyright: (c) 1997-2001 wxWindows team
9 * Licence: wxWindows license
12 /* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */
14 #ifndef _WX_PLATFORM_H_
15 #define _WX_PLATFORM_H_
18 first define Windows symbols if they're not defined on the command line: we
19 can autodetect everything we need if _WIN32 is defined
21 #if defined(_WIN32) || defined(WIN32) || defined(__NT__)
30 /* Win95 means Win95-style UI, i.e. Win9x/NT 4+ */
31 #if !defined(__WIN95__) && defined(WINVER) && (WINVER >= 0x0400)
36 #if defined(__WXMSW__) || defined(__WIN32__)
37 #if !defined(__WINDOWS__)
54 #if defined(TWIN32) && !defined(__TWIN32__)
59 Include wx/setup.h for the Unix platform defines generated by configure and
60 the library compilation options
64 /* check the consistency of the settings in setup.h */
65 #include "wx/chkconf.h"
68 old C++ headers (like <iostream.h>) declare classes in the global namespace
69 while the new, standard ones (like <iostream>) do it in std:: namespace
71 using this macro allows constuctions like "wxSTD iostream" to work in
81 OS: first of all, test for MS-DOS platform. We must do this before testing
82 for Unix, because DJGPP compiler defines __unix__ under MS-DOS
84 #if defined(__GO32__) || defined(__DJGPP__) || defined(__DOS__)
88 /* size_t is the same as unsigned int for Watcom 11 compiler, */
89 /* so define it if it hadn't been done by configure yet */
90 #if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG)
92 #define wxSIZE_T_IS_UINT
95 #define wxSIZE_T_IS_ULONG
100 OS: then test for generic Unix defines, then for particular flavours and
101 finally for Unix-like systems
103 #elif defined(__UNIX__) || defined(__unix) || defined(__unix__) || \
104 defined(____SVR4____) || defined(__LINUX__) || defined(__sgi) || \
105 defined(__hpux) || defined(sun) || defined(__SUN__) || defined(_AIX) || \
106 defined(__EMX__) || defined(__VMS) || defined(__BEOS__)
108 #define __UNIX_LIKE__
110 /* Helps SGI compilation, apparently */
113 #define __need_wchar_t
116 Note I use the term __SGI_CC__ for both cc and CC, its not a good
117 idea to mix gcc and cc/CC, the name mangling is different
120 #endif /* gcc/!gcc */
123 #if defined(sun) || defined(__SUN__)
132 #define OS2EMX_PLAIN_CHAR
135 /* define __HPUX__ for HP-UX where standard macro is __hpux */
136 #if defined(__hpux) && !defined(__HPUX__)
140 #if defined(__WXMAC__) && defined(__DARWIN__)
144 Some code has been added to workaround defects(?) in the
145 bundled gcc compiler. These corrections are identified by:
146 __DARWIN__ for corrections necessary for Darwin (wxMac, wxMotif)
149 #include <Carbon/Carbon.h>
150 #endif /* __WXMAC__ && __DARWIN__ */
152 #if defined(__CYGWIN__)
153 #if !defined(wxSIZE_T_IS_UINT)
154 #define wxSIZE_T_IS_UINT
157 #elif defined(applec) || \
158 defined(THINK_C) || \
159 (defined(__MWERKS__) && !defined(__INTEL__))
161 #elif defined(__WXMAC__) && defined(__DARWIN__)
163 #define __UNIX_LIKE__
166 Some code has been added to workaround defects(?) in the
167 bundled gcc compiler. These corrections are identified by:
168 __DARWIN__ for corrections necessary for Darwin (wxMac, wxMotif)
171 #include <Carbon/Carbon.h>
172 #elif defined(__OS2__)
173 #if defined(__IBMCPP__)
174 #define __VISAGEAVER__ __IBMCPP__
183 /* Place other OS/2 compiler environment defines here */
184 #if defined(__VISAGECPP__)
185 /* VisualAge is the only thing that understands _Optlink */
186 #define LINKAGEMODE _Optlink
188 #define wxSIZE_T_IS_UINT
195 /* to be changed for Win64! */
201 define another standard symbol for Microsoft Visual C++: the standard
202 one (_MSC_VER) is also defined by Metrowerks compiler
204 #if defined(_MSC_VER) && !defined(__MWERKS__)
205 #define __VISUALC__ _MSC_VER
206 #elif defined(__BCPLUSPLUS__) && !defined(__BORLANDC__)
208 #elif defined(__WATCOMC__)
209 #elif defined(__SC__)
210 #define __SYMANTECC__
211 #endif /* compiler */
213 /* size_t is the same as unsigned int for all Windows compilers we know, */
214 /* so define it if it hadn't been done by configure yet */
215 #if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG)
216 #define wxSIZE_T_IS_UINT
221 if we're on a Unix system but didn't use configure (so that setup.h didn't
222 define __UNIX__), do define __UNIX__ now
224 #if !defined(__UNIX__) && defined(__UNIX_LIKE__)
228 #if defined(__HPUX__) && !defined(__WXGTK__)
231 #endif /* __WXMOTIF__ */
234 #if defined(__WXMOTIF__)
239 This macro can be used to check that the version of mingw32 compiler is
242 #if defined( __GNUWIN32__ ) || defined( __MINGW32__ ) || defined( __CYGWIN__ )
243 #include "wx/msw/gccpriv.h"
245 #undef wxCHECK_W32API_VERSION
246 #define wxCHECK_W32API_VERSION(maj, min) (0)
249 #endif /* _WX_PLATFORM_H_ */