]>
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_
19 Codewarrior doesn't define any Windows symbols until some headers
24 #if defined(WIN32) || defined(_WIN32)
33 first define Windows symbols if they're not defined on the command line: we
34 can autodetect everything we need if _WIN32 is defined
36 #if defined(__CYGWIN32__) && !defined(__WXMOTIF__) && !defined(__WXGTK__) \
37 && !defined(__WXX11__)
38 /* for Cygwin, default to wxMSW unless otherwise specified */
52 #if defined(_WIN32) || defined(WIN32) || defined(__NT__) || defined(__WXWINCE__)
61 /* Win95 means Win95-style UI, i.e. Win9x/NT 4+ */
62 #if !defined(__WIN95__) && defined(WINVER) && (WINVER >= 0x0400)
67 #if defined(__WXMSW__) || defined(__WIN32__)
68 #if !defined(__WINDOWS__)
79 #if defined(TWIN32) && !defined(__TWIN32__)
84 Include wx/setup.h for the Unix platform defines generated by configure and
85 the library compilation options
89 /* check the consistency of the settings in setup.h */
90 #include "wx/chkconf.h"
93 old C++ headers (like <iostream.h>) declare classes in the global namespace
94 while the new, standard ones (like <iostream>) do it in std:: namespace
96 using this macro allows constuctions like "wxSTD iostream" to work in
106 OS: first of all, test for MS-DOS platform. We must do this before testing
107 for Unix, because DJGPP compiler defines __unix__ under MS-DOS
109 #if defined(__GO32__) || defined(__DJGPP__) || defined(__DOS__)
113 /* size_t is the same as unsigned int for Watcom 11 compiler, */
114 /* so define it if it hadn't been done by configure yet */
115 #if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG)
117 #define wxSIZE_T_IS_UINT
120 #define wxSIZE_T_IS_ULONG
125 OS: then test for generic Unix defines, then for particular flavours and
126 finally for Unix-like systems
128 #elif defined(__UNIX__) || defined(__unix) || defined(__unix__) || \
129 defined(____SVR4____) || defined(__LINUX__) || defined(__sgi) || \
130 defined(__hpux) || defined(sun) || defined(__SUN__) || defined(_AIX) || \
131 defined(__EMX__) || defined(__VMS) || defined(__BEOS__)
133 #define __UNIX_LIKE__
135 /* Helps SGI compilation, apparently */
138 #define __need_wchar_t
141 Note I use the term __SGI_CC__ for both cc and CC, its not a good
142 idea to mix gcc and cc/CC, the name mangling is different
145 #endif /* gcc/!gcc */
148 #if defined(sun) || defined(__SUN__)
157 #define OS2EMX_PLAIN_CHAR
160 /* define __HPUX__ for HP-UX where standard macro is __hpux */
161 #if defined(__hpux) && !defined(__HPUX__)
165 #if defined(__CYGWIN__) || defined(__WINE__)
166 #if !defined(wxSIZE_T_IS_UINT)
167 #define wxSIZE_T_IS_UINT
170 #elif defined(applec) || \
171 defined(THINK_C) || \
172 (defined(__MWERKS__) && !defined(__INTEL__))
174 #if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG)
175 #define wxSIZE_T_IS_ULONG
177 #elif defined(__WXMAC__) && defined(__APPLE__)
179 #define __UNIX_LIKE__
182 These defines are needed when compiling using Project Builder
183 with a non generated setup0.h
195 #define __POWERPC__ 1
198 #if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG)
199 #define wxSIZE_T_IS_ULONG
202 Some code has been added to workaround defects(?) in the
203 bundled gcc compiler. These corrections are identified by
204 __DARWIN__ for Darwin related corrections (wxMac, wxMotif)
206 #elif defined(__OS2__)
207 #if defined(__IBMCPP__)
208 #define __VISAGEAVER__ __IBMCPP__
217 /* Place other OS/2 compiler environment defines here */
218 #if defined(__VISAGECPP__)
219 /* VisualAge is the only thing that understands _Optlink */
220 #define LINKAGEMODE _Optlink
222 #define wxSIZE_T_IS_UINT
229 /* to be changed for Win64! */
235 define another standard symbol for Microsoft Visual C++: the standard
236 one (_MSC_VER) is also defined by Metrowerks compiler
238 #if defined(_MSC_VER) && !defined(__MWERKS__)
239 #define __VISUALC__ _MSC_VER
240 #elif defined(__BCPLUSPLUS__) && !defined(__BORLANDC__)
242 #elif defined(__WATCOMC__)
243 #elif defined(__SC__)
244 #define __SYMANTECC__
245 #endif /* compiler */
247 /* size_t is the same as unsigned int for all Windows compilers we know, */
248 /* so define it if it hadn't been done by configure yet */
249 #if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG)
250 #define wxSIZE_T_IS_UINT
255 if we're on a Unix system but didn't use configure (so that setup.h didn't
256 define __UNIX__), do define __UNIX__ now
258 #if !defined(__UNIX__) && defined(__UNIX_LIKE__)
262 #if defined(__HPUX__) && !defined(__WXGTK__)
265 #endif /* __WXMOTIF__ */
268 #if defined(__WXMOTIF__) || defined(__WXX11__)
273 This macro can be used to test the gcc version and can be used like this:
275 #if wxCHECK_GCC_VERSION(3, 1)
276 ... we have gcc 3.1 or later ...
278 ... no gcc at all or gcc < 3.1 ...
281 #define wxCHECK_GCC_VERSION( major, minor ) \
282 ( defined(__GNUC__) && defined(__GNUC_MINOR__) \
283 && ( ( __GNUC__ > (major) ) \
284 || ( __GNUC__ == (major) && __GNUC_MINOR__ >= (minor) ) ) )
287 This macro can be used to check that the version of mingw32 compiler is
290 #if defined( __GNUWIN32__ ) || defined( __MINGW32__ ) || defined( __CYGWIN__ )
291 #include "wx/msw/gccpriv.h"
293 #undef wxCHECK_W32API_VERSION
294 #define wxCHECK_W32API_VERSION(maj, min) (0)
297 #endif /* _WX_PLATFORM_H_ */