]>
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 licence
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
27 first define Windows symbols if they're not defined on the command line: we
28 can autodetect everything we need if _WIN32 is defined
30 #if defined(__CYGWIN32__) && !defined(__WXMOTIF__) && !defined(__WXGTK__) \
31 && !defined(__WXX11__)
32 /* for Cygwin, default to wxMSW unless otherwise specified */
46 #if defined(_WIN32) || defined(WIN32) || defined(__NT__) || defined(__WXWINCE__)
56 see MSDN for the description of possible WINVER values, this one is a
57 good default and, anyhow, we check for most of the features we use
64 /* Win95 means Win95-style UI, i.e. Win9x/NT 4+ */
65 #if !defined(__WIN95__) && (WINVER >= 0x0400)
70 #if defined(__WXMSW__) || defined(__WIN32__)
71 #if !defined(__WINDOWS__)
83 Include wx/setup.h for the Unix platform defines generated by configure and
84 the library compilation options
88 /* check the consistency of the settings in setup.h */
89 #include "wx/chkconf.h"
92 some compilers don't support iostream.h any longer, so override the users
93 setting here in such case.
95 #if defined(_MSC_VER) && (_MSC_VER >= 1310)
96 #undef wxUSE_IOSTREAMH
97 #define wxUSE_IOSTREAMH 0
98 #endif /* compilers not supporting iostream.h */
101 old C++ headers (like <iostream.h>) declare classes in the global namespace
102 while the new, standard ones (like <iostream>) do it in std:: namespace
104 using this macro allows constuctions like "wxSTD iostream" to work in
114 OS: first of all, test for MS-DOS platform. We must do this before testing
115 for Unix, because DJGPP compiler defines __unix__ under MS-DOS
117 #if defined(__GO32__) || defined(__DJGPP__) || defined(__DOS__)
121 /* size_t is the same as unsigned int for Watcom 11 compiler, */
122 /* so define it if it hadn't been done by configure yet */
123 #if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG)
125 #define wxSIZE_T_IS_UINT
128 #define wxSIZE_T_IS_ULONG
133 OS: then test for generic Unix defines, then for particular flavours and
134 finally for Unix-like systems
136 #elif defined(__UNIX__) || defined(__unix) || defined(__unix__) || \
137 defined(____SVR4____) || defined(__LINUX__) || defined(__sgi) || \
138 defined(__hpux) || defined(sun) || defined(__SUN__) || defined(_AIX) || \
139 defined(__EMX__) || defined(__VMS) || defined(__BEOS__)
141 #define __UNIX_LIKE__
143 /* Helps SGI compilation, apparently */
146 #define __need_wchar_t
149 Note I use the term __SGI_CC__ for both cc and CC, its not a good
150 idea to mix gcc and cc/CC, the name mangling is different
153 #endif /* gcc/!gcc */
156 #if defined(sun) || defined(__SUN__)
165 #define OS2EMX_PLAIN_CHAR
168 /* define __HPUX__ for HP-UX where standard macro is __hpux */
169 #if defined(__hpux) && !defined(__HPUX__)
173 #if defined(__CYGWIN__) || defined(__WINE__)
174 #if !defined(wxSIZE_T_IS_UINT)
175 #define wxSIZE_T_IS_UINT
178 #elif defined(applec) || \
179 defined(THINK_C) || \
180 (defined(__MWERKS__) && !defined(__INTEL__))
182 #if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG)
183 #define wxSIZE_T_IS_ULONG
185 #elif defined(__WXMAC__) && defined(__APPLE__)
187 #define __UNIX_LIKE__
190 These defines are needed when compiling using Project Builder
191 with a non generated setup0.h
203 #define __POWERPC__ 1
205 #ifndef TARGET_CARBON
206 #define TARGET_CARBON 1
209 #if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG)
210 #define wxSIZE_T_IS_ULONG
213 Some code has been added to workaround defects(?) in the
214 bundled gcc compiler. These corrections are identified by
215 __DARWIN__ for Darwin related corrections (wxMac, wxMotif)
217 #elif defined(__OS2__)
218 #if defined(__IBMCPP__)
219 #define __VISAGEAVER__ __IBMCPP__
228 /* Place other OS/2 compiler environment defines here */
229 #if defined(__VISAGECPP__)
230 /* VisualAge is the only thing that understands _Optlink */
231 #define LINKAGEMODE _Optlink
233 #define wxSIZE_T_IS_UINT
240 /* to be changed for Win64! */
246 define another standard symbol for Microsoft Visual C++: the standard
247 one (_MSC_VER) is also defined by Metrowerks compiler
249 #if defined(_MSC_VER) && !defined(__MWERKS__)
250 #define __VISUALC__ _MSC_VER
251 #elif defined(__BCPLUSPLUS__) && !defined(__BORLANDC__)
253 #elif defined(__WATCOMC__)
254 #elif defined(__SC__)
255 #define __SYMANTECC__
256 #endif /* compiler */
258 /* size_t is the same as unsigned int for all Windows compilers we know, */
259 /* so define it if it hadn't been done by configure yet */
260 #if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG)
261 #define wxSIZE_T_IS_UINT
266 if we're on a Unix system but didn't use configure (so that setup.h didn't
267 define __UNIX__), do define __UNIX__ now
269 #if !defined(__UNIX__) && defined(__UNIX_LIKE__)
273 #if defined(__HPUX__) && !defined(__WXGTK__)
276 #endif /* __WXMOTIF__ */
279 #if defined(__WXMOTIF__) || defined(__WXX11__)
284 This macro can be used to test the gcc version and can be used like this:
286 #if wxCHECK_GCC_VERSION(3, 1)
287 ... we have gcc 3.1 or later ...
289 ... no gcc at all or gcc < 3.1 ...
292 #define wxCHECK_GCC_VERSION( major, minor ) \
293 ( defined(__GNUC__) && defined(__GNUC_MINOR__) \
294 && ( ( __GNUC__ > (major) ) \
295 || ( __GNUC__ == (major) && __GNUC_MINOR__ >= (minor) ) ) )
298 This macro can be used to check that the version of mingw32 compiler is
301 #if defined( __GNUWIN32__ ) || defined( __MINGW32__ ) || \
302 defined( __CYGWIN__ ) || \
303 (defined(__WATCOMC__) && __WATCOMC__ >= 1200) || defined(__DIGITALMARS__)
304 #include "wx/msw/gccpriv.h"
306 #undef wxCHECK_W32API_VERSION
307 #define wxCHECK_W32API_VERSION(maj, min) (0)
312 #define __DIGITALMARS__
318 #if defined (__WXMSW__)
319 #if !defined(__WATCOMC__)
320 #define wxHAVE_RAW_BITMAP
324 #if defined (__WXMAC__)
325 #ifndef WORDS_BIGENDIAN
326 #define WORDS_BIGENDIAN 1
330 /* Choose which method we will use for updating menus
331 * - in OnIdle, or when we receive a wxEVT_MENU_OPEN event.
332 * Presently, only Windows and GTK+ support wxEVT_MENU_OPEN.
334 #ifndef wxUSE_IDLEMENUUPDATES
335 #if (defined(__WXMSW__) && !defined(__WXWINCE)) ||\
337 #define wxUSE_IDLEMENUUPDATES 0
339 #define wxUSE_IDLEMENUUPDATES 1
344 * Define symbols that are not yet in
345 * configure or possibly some setup.h files.
346 * They will need to be added.
349 #ifndef wxUSE_FILECONFIG
351 #define wxUSE_FILECONFIG 1
353 #define wxUSE_FILECONFIG 0
358 #define wxUSE_HOTKEY 0
361 #if !defined(wxUSE_WXDIB) && defined(__WXMSW__)
362 #define wxUSE_WXDIB 1
365 #endif /* _WX_PLATFORM_H_ */