]>
Commit | Line | Data |
---|---|---|
e0c749a7 RN |
1 | /** |
2 | * Name: wx/platform.h | |
3 | * Purpose: define the OS and compiler identification macros | |
4 | * Author: Vadim Zeitlin | |
5 | * Modified by: | |
6 | * Created: 29.10.01 (extracted from wx/defs.h) | |
7 | * RCS-ID: $Id$ | |
99d80019 | 8 | * Copyright: (c) 1997-2001 Vadim Zeitlin |
65571936 | 9 | * Licence: wxWindows licence |
e0c749a7 | 10 | */ |
78340847 VZ |
11 | |
12 | /* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */ | |
13 | ||
14 | #ifndef _WX_PLATFORM_H_ | |
15 | #define _WX_PLATFORM_H_ | |
16 | ||
a203834e MB |
17 | |
18 | /* | |
19 | Codewarrior doesn't define any Windows symbols until some headers | |
20 | are included | |
21 | */ | |
498919dd | 22 | #ifdef __MWERKS__ |
4b4e81ee VZ |
23 | # include <stddef.h> |
24 | #endif | |
25 | ||
cf6fa9b9 | 26 | /* |
761fbb87 WS |
27 | WXMAC variants |
28 | __WXMAC_CLASSIC__ means ppc non-carbon builds, __WXMAC_CARBON__ means | |
29 | carbon API available (mach or cfm builds) , __WXMAC_OSX__ means mach-o | |
30 | builds, running under 10.2 + only | |
cf6fa9b9 SC |
31 | */ |
32 | #ifdef __WXMAC__ | |
d80fc6df | 33 | # if defined(__MACH__) |
9543e985 | 34 | # define __WXMAC_OSX__ |
623633ee | 35 | # define __WXMAC_CARBON__ /* for backwards compat in user code still defined */ |
cdac585c | 36 | # include <AvailabilityMacros.h> |
c5e51452 SC |
37 | # ifndef MAC_OS_X_VERSION_10_4 |
38 | # define MAC_OS_X_VERSION_10_4 1040 | |
39 | # endif | |
40 | # ifndef MAC_OS_X_VERSION_10_5 | |
41 | # define MAC_OS_X_VERSION_10_5 1050 | |
42 | # endif | |
d80fc6df | 43 | # ifdef __WXMAC_XCODE__ |
819f6fb9 | 44 | # include <unistd.h> |
d80fc6df VZ |
45 | # include "wx/mac/carbon/config_xcode.h" |
46 | # endif | |
47 | # else | |
623633ee | 48 | # error "only mach-o configurations are supported" |
d80fc6df VZ |
49 | # endif |
50 | #endif | |
51 | ||
52 | /* | |
53 | __WXOSX__ is a common define to wxMac (Carbon) and wxCocoa ports under OS X. | |
305142ad DE |
54 | |
55 | DO NOT use this define in base library code. Although wxMac has its own | |
56 | private base library (and thus __WXOSX__,__WXMAC__ and related defines are | |
57 | valid there), wxCocoa shares its library with other ports like wxGTK and wxX11. | |
58 | ||
59 | To keep wx authors from screwing this up, only enable __WXOSX__ for wxCocoa when | |
60 | not compiling the base library. We determine this by first checking if | |
61 | wxUSE_BASE is not defined. If it is not defined, then we're not buildling | |
62 | the base library, and possibly not building wx at all (but actually building | |
63 | user code that's using wx). If it is defined then we must check to make sure | |
64 | it is not true. If it is true, we're building base. | |
65 | ||
66 | If you want it in the common darwin base library then use __DARWIN__. You | |
67 | can use any Darwin-available libraries like CoreFoundation but please avoid | |
68 | using OS X libraries like Carbon or CoreServices. | |
69 | ||
d80fc6df | 70 | */ |
305142ad | 71 | #if defined(__WXMAC_OSX__) || (defined(__WXCOCOA__) && (!defined(wxUSE_BASE) || !wxUSE_BASE)) |
d80fc6df | 72 | # define __WXOSX__ |
cf6fa9b9 SC |
73 | #endif |
74 | ||
78340847 VZ |
75 | /* |
76 | first define Windows symbols if they're not defined on the command line: we | |
77 | can autodetect everything we need if _WIN32 is defined | |
78 | */ | |
7275146d | 79 | #if defined(__CYGWIN__) && defined(__WINDOWS__) |
ef620df0 VZ |
80 | # ifndef __WXMSW__ |
81 | # define __WXMSW__ | |
82 | # endif | |
d66dcb60 | 83 | |
ef620df0 VZ |
84 | # ifndef _WIN32 |
85 | # define _WIN32 | |
86 | # endif | |
d66dcb60 | 87 | |
ef620df0 VZ |
88 | # ifndef WIN32 |
89 | # define WIN32 | |
90 | # endif | |
d66dcb60 MB |
91 | #endif |
92 | ||
4055ed82 | 93 | #if defined(__PALMOS__) |
63ccc659 WS |
94 | # if __PALMOS__ == 0x06000000 |
95 | # define __WXPALMOS6__ | |
96 | # endif | |
97 | # if __PALMOS__ == 0x05000000 | |
98 | # define __WXPALMOS5__ | |
99 | # endif | |
4055ed82 WS |
100 | # ifndef __WXPALMOS__ |
101 | # define __WXPALMOS__ | |
102 | # endif | |
103 | # ifdef __WXMSW__ | |
104 | # undef __WXMSW__ | |
105 | # endif | |
106 | # ifdef __WINDOWS__ | |
107 | # undef __WINDOWS__ | |
108 | # endif | |
109 | # ifdef __WIN32__ | |
110 | # undef __WIN32__ | |
111 | # endif | |
112 | # ifdef WIN32 | |
113 | # undef WIN32 | |
114 | # endif | |
115 | # ifdef _WIN32 | |
116 | # undef _WIN32 | |
117 | # endif | |
118 | #endif | |
119 | ||
ef620df0 VZ |
120 | #if defined(_WIN64) |
121 | # ifndef _WIN32 | |
122 | /* | |
123 | a lot of code (mistakenly) uses #ifdef _WIN32 to either test for | |
124 | Windows or to test for !__WIN16__, so we must define _WIN32 for | |
125 | Win64 as well to ensure that the existing code continues to work. | |
126 | */ | |
127 | # define _WIN32 | |
128 | # endif /* !_WIN32 */ | |
129 | ||
130 | # ifndef __WIN64__ | |
131 | # define __WIN64__ | |
132 | # endif /* !__WIN64__ */ | |
133 | #endif /* _WIN64 */ | |
134 | ||
d5cd19b4 VZ |
135 | #if (defined(_WIN32) || defined(WIN32) || defined(__NT__) || defined(__WXWINCE__)) \ |
136 | && !defined(__WXMOTIF__) && !defined(__WXGTK__) && !defined(__WXX11__) | |
ef620df0 VZ |
137 | # ifndef __WXMSW__ |
138 | # define __WXMSW__ | |
139 | # endif | |
78340847 | 140 | |
ef620df0 VZ |
141 | # ifndef __WIN32__ |
142 | # define __WIN32__ | |
ef620df0 | 143 | # endif |
78340847 VZ |
144 | #endif /* Win32 */ |
145 | ||
146 | #if defined(__WXMSW__) || defined(__WIN32__) | |
9b141468 WS |
147 | # if !defined(__WINDOWS__) |
148 | # define __WINDOWS__ | |
149 | # endif | |
78340847 VZ |
150 | #endif |
151 | ||
9b141468 | 152 | /* detect MS SmartPhone */ |
f2aa588b | 153 | #if defined( WIN32_PLATFORM_WFSP ) |
9b141468 WS |
154 | # ifndef __SMARTPHONE__ |
155 | # define __SMARTPHONE__ | |
156 | # endif | |
157 | # ifndef __WXWINCE__ | |
158 | # define __WXWINCE__ | |
159 | # endif | |
f2aa588b VS |
160 | #endif |
161 | ||
a9928e9d JS |
162 | /* detect PocketPC */ |
163 | #if defined( WIN32_PLATFORM_PSPC ) | |
9b141468 WS |
164 | # ifndef __POCKETPC__ |
165 | # define __POCKETPC__ | |
166 | # endif | |
167 | # ifndef __WXWINCE__ | |
168 | # define __WXWINCE__ | |
169 | # endif | |
a9928e9d JS |
170 | #endif |
171 | ||
172 | /* detect Standard WinCE SDK */ | |
173 | #if defined( WCE_PLATFORM_STANDARDSDK ) | |
9b141468 WS |
174 | # ifndef __WINCE_STANDARDSDK__ |
175 | # define __WINCE_STANDARDSDK__ | |
176 | # endif | |
177 | # ifndef __WXWINCE__ | |
178 | # define __WXWINCE__ | |
179 | # endif | |
a9928e9d JS |
180 | #endif |
181 | ||
daeb8330 RR |
182 | #if defined(_WIN32_WCE) && !defined(WIN32_PLATFORM_WFSP) && !defined(WIN32_PLATFORM_PSPC) |
183 | # if (_WIN32_WCE >= 400) | |
184 | # ifndef __WINCE_NET__ | |
185 | # define __WINCE_NET__ | |
186 | # endif | |
761fbb87 | 187 | # elif (_WIN32_WCE >= 200) |
daeb8330 RR |
188 | # ifndef __HANDHELDPC__ |
189 | # define __HANDHELDPC__ | |
190 | # endif | |
191 | # endif | |
9b141468 WS |
192 | # ifndef __WXWINCE__ |
193 | # define __WXWINCE__ | |
194 | # endif | |
daeb8330 RR |
195 | #endif |
196 | ||
f1a4ca62 WS |
197 | #if defined(__POCKETPC__) || defined(__SMARTPHONE__) || defined(__WXGPE__) |
198 | # define __WXHANDHELD__ | |
199 | #endif | |
200 | ||
592a7465 VZ |
201 | /* |
202 | Include wx/setup.h for the Unix platform defines generated by configure and | |
203 | the library compilation options | |
204 | ||
205 | Note that it must be included before defining hardware symbols below as they | |
206 | could be already defined by configure | |
207 | */ | |
208 | #include "wx/setup.h" | |
209 | ||
748a4684 VZ |
210 | /* |
211 | Hardware platform detection. | |
212 | ||
213 | VC++ defines _M_xxx symbols. | |
214 | */ | |
215 | #if defined(_M_IX86) || defined(i386) || defined(__i386) || defined(__i386__) | |
216 | #ifndef __INTEL__ | |
217 | #define __INTEL__ | |
218 | #endif | |
219 | #endif /* x86 */ | |
220 | ||
221 | #if defined(_M_IA64) | |
222 | #ifndef __IA64__ | |
223 | #define __IA64__ | |
224 | #endif | |
225 | #endif /* ia64 */ | |
226 | ||
80da12bc | 227 | #if defined(_M_MPPC) || defined(__PPC__) || defined(__ppc__) |
748a4684 VZ |
228 | #ifndef __POWERPC__ |
229 | #define __POWERPC__ | |
230 | #endif | |
231 | #endif /* alpha */ | |
232 | ||
233 | #if defined(_M_ALPHA) || defined(__AXP__) | |
234 | #ifndef __ALPHA__ | |
235 | #define __ALPHA__ | |
236 | #endif | |
237 | #endif /* alpha */ | |
238 | ||
78340847 | 239 | |
63e7198b VZ |
240 | /* |
241 | adjust the Unicode setting: wxUSE_UNICODE should be defined as 0 or 1 | |
77ffb593 | 242 | and is used by wxWidgets, _UNICODE and/or UNICODE may be defined or used by |
63e7198b VZ |
243 | the system headers so bring these settings in sync |
244 | */ | |
245 | ||
246 | /* set wxUSE_UNICODE to 1 if UNICODE or _UNICODE is defined */ | |
247 | #if defined(_UNICODE) || defined(UNICODE) | |
248 | # undef wxUSE_UNICODE | |
249 | # define wxUSE_UNICODE 1 | |
250 | #else /* !UNICODE */ | |
251 | # ifndef wxUSE_UNICODE | |
252 | # define wxUSE_UNICODE 0 | |
253 | # endif | |
254 | #endif /* UNICODE/!UNICODE */ | |
255 | ||
256 | /* and vice versa: define UNICODE and _UNICODE if wxUSE_UNICODE is 1 */ | |
257 | #if wxUSE_UNICODE | |
258 | # ifndef _UNICODE | |
259 | # define _UNICODE | |
260 | # endif | |
261 | # ifndef UNICODE | |
262 | # define UNICODE | |
263 | # endif | |
264 | #endif /* wxUSE_UNICODE */ | |
265 | ||
b3c35859 | 266 | #if defined( __MWERKS__ ) && !defined(__INTEL__) |
3b2b40b4 | 267 | /* otherwise MSL headers bring in WIN32 dependant APIs */ |
b3c35859 SC |
268 | #undef UNICODE |
269 | #endif | |
79e70894 VZ |
270 | |
271 | ||
63ef7db3 | 272 | /* test for old versions of Borland C, normally need at least 5.82, Turbo explorer, |
6b73ac78 CE |
273 | available for free at http://www.turboexplorer.com/downloads |
274 | */ | |
63ef7db3 CE |
275 | #if defined(__BORLANDC__) && (__BORLANDC__ < 0x550) |
276 | #error "This version of wxWidgets requires a newer version of Borland - we recommend 5.82 (Turbo Explorer); You may at your own risk remove this line and try your system" | |
277 | #endif /* __BORLANDC__ */ | |
278 | ||
279 | #if defined(__BORLANDC__) && (__BORLANDC__ < 0x582) && (__BORLANDC__ > 0x559) | |
280 | #error "This version of wxWidgets has problems with Borland 5.6; we recommend getting Borland 5.82 (Turbo Explorer); You may at your own risk remove this line and try your system" | |
c266eff9 | 281 | #endif /* __BORLANDC__ */ |
6b73ac78 CE |
282 | |
283 | ||
6d3d756a WS |
284 | /* |
285 | This macro can be used to test the Open Watcom version. | |
286 | */ | |
287 | #ifndef __WATCOMC__ | |
288 | # define wxWATCOM_VERSION(major,minor) 0 | |
289 | # define wxCHECK_WATCOM_VERSION(major,minor) 0 | |
290 | # define wxONLY_WATCOM_EARLIER_THAN(major,minor) 0 | |
291 | #elif defined(__WATCOMC__) && __WATCOMC__ < 1200 | |
292 | # error "Only Open Watcom is supported in this release" | |
293 | #else | |
294 | # define wxWATCOM_VERSION(major,minor) ( major * 100 + minor * 10 + 1100 ) | |
295 | # define wxCHECK_WATCOM_VERSION(major,minor) ( __WATCOMC__ >= wxWATCOM_VERSION(major,minor) ) | |
296 | # define wxONLY_WATCOM_EARLIER_THAN(major,minor) ( __WATCOMC__ < wxWATCOM_VERSION(major,minor) ) | |
297 | #endif | |
298 | ||
78340847 | 299 | /* |
865c589e VS |
300 | OS: first of all, test for MS-DOS platform. We must do this before testing |
301 | for Unix, because DJGPP compiler defines __unix__ under MS-DOS | |
302 | */ | |
303 | #if defined(__GO32__) || defined(__DJGPP__) || defined(__DOS__) | |
ef620df0 VZ |
304 | # ifndef __DOS__ |
305 | # define __DOS__ | |
306 | # endif | |
865c589e VS |
307 | /* size_t is the same as unsigned int for Watcom 11 compiler, */ |
308 | /* so define it if it hadn't been done by configure yet */ | |
ef620df0 VZ |
309 | # if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG) |
310 | # ifdef __WATCOMC__ | |
311 | # define wxSIZE_T_IS_UINT | |
312 | # endif | |
313 | # ifdef __DJGPP__ | |
314 | # define wxSIZE_T_IS_ULONG | |
315 | # endif | |
316 | # endif | |
865c589e VS |
317 | |
318 | /* | |
319 | OS: then test for generic Unix defines, then for particular flavours and | |
78340847 | 320 | finally for Unix-like systems |
80da12bc | 321 | Mac OS X matches this case (__MACH__), prior Mac OS do not. |
78340847 | 322 | */ |
865c589e VS |
323 | #elif defined(__UNIX__) || defined(__unix) || defined(__unix__) || \ |
324 | defined(____SVR4____) || defined(__LINUX__) || defined(__sgi) || \ | |
325 | defined(__hpux) || defined(sun) || defined(__SUN__) || defined(_AIX) || \ | |
80da12bc | 326 | defined(__EMX__) || defined(__VMS) || defined(__BEOS__) || defined(__MACH__) |
78340847 | 327 | |
ef620df0 | 328 | # define __UNIX_LIKE__ |
78340847 VZ |
329 | |
330 | /* Helps SGI compilation, apparently */ | |
ef620df0 VZ |
331 | # ifdef __SGI__ |
332 | # ifdef __GNUG__ | |
333 | # define __need_wchar_t | |
334 | # else /* !gcc */ | |
78340847 VZ |
335 | /* |
336 | Note I use the term __SGI_CC__ for both cc and CC, its not a good | |
337 | idea to mix gcc and cc/CC, the name mangling is different | |
338 | */ | |
ef620df0 VZ |
339 | # define __SGI_CC__ |
340 | # endif /* gcc/!gcc */ | |
ae072480 VZ |
341 | |
342 | /* system headers use this symbol and not __cplusplus in some places */ | |
343 | # ifndef _LANGUAGE_C_PLUS_PLUS | |
344 | # define _LANGUAGE_C_PLUS_PLUS | |
345 | # endif | |
ef620df0 VZ |
346 | # endif /* SGI */ |
347 | ||
2686d933 VZ |
348 | # if defined(__SUNPRO_CC) |
349 | # ifndef __SUNCC__ | |
350 | # define __SUNCC__ __SUNPRO_CC | |
351 | # endif /* Sun CC */ | |
352 | # endif /* Sun CC */ | |
ef620df0 VZ |
353 | |
354 | # ifdef __EMX__ | |
355 | # define OS2EMX_PLAIN_CHAR | |
356 | # endif | |
78340847 VZ |
357 | |
358 | /* define __HPUX__ for HP-UX where standard macro is __hpux */ | |
ef620df0 VZ |
359 | # if defined(__hpux) && !defined(__HPUX__) |
360 | # define __HPUX__ | |
361 | # endif /* HP-UX */ | |
362 | ||
363 | # if defined(__CYGWIN__) || defined(__WINE__) | |
364 | # if !defined(wxSIZE_T_IS_UINT) | |
365 | # define wxSIZE_T_IS_UINT | |
366 | # endif | |
367 | # endif | |
80da12bc DE |
368 | |
369 | /* All of these should already be defined by including configure- | |
370 | generated setup.h but we wish to support Xcode compilation without | |
371 | requiring the user to define these himself. | |
372 | */ | |
373 | # if defined(__APPLE__) && defined(__MACH__) | |
374 | # ifndef __UNIX__ | |
375 | # define __UNIX__ 1 | |
376 | # endif | |
377 | # ifndef __BSD__ | |
378 | # define __BSD__ 1 | |
379 | # endif | |
380 | /* __DARWIN__ is our own define to mean OS X or pure Darwin */ | |
381 | # ifndef __DARWIN__ | |
382 | # define __DARWIN__ 1 | |
383 | # endif | |
384 | /* NOTE: TARGET_CARBON is actually a 0/1 and must be 1 for OS X */ | |
385 | # ifndef TARGET_CARBON | |
386 | # define TARGET_CARBON 1 | |
387 | # endif | |
388 | /* OS X uses unsigned long size_t for both ILP32 and LP64 modes. */ | |
389 | # if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG) | |
390 | # define wxSIZE_T_IS_ULONG | |
391 | # endif | |
392 | # endif | |
393 | ||
394 | /* | |
395 | OS: Classic Mac OS | |
396 | */ | |
78340847 VZ |
397 | #elif defined(applec) || \ |
398 | defined(THINK_C) || \ | |
399 | (defined(__MWERKS__) && !defined(__INTEL__)) | |
400 | /* MacOS */ | |
ef620df0 VZ |
401 | # if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG) |
402 | # define wxSIZE_T_IS_ULONG | |
403 | # endif | |
78340847 | 404 | |
80da12bc DE |
405 | /* |
406 | OS: OS/2 | |
407 | */ | |
78340847 | 408 | #elif defined(__OS2__) |
55034339 WS |
409 | |
410 | /* wxOS2 vs. non wxOS2 ports on OS2 platform */ | |
fbf618df | 411 | # if !defined(__WXMOTIF__) && !defined(__WXGTK__) && !defined(__WXX11__) |
55034339 WS |
412 | # ifndef __WXPM__ |
413 | # define __WXPM__ | |
414 | # endif | |
415 | # endif | |
416 | ||
ef620df0 VZ |
417 | # if defined(__IBMCPP__) |
418 | # define __VISAGEAVER__ __IBMCPP__ | |
ef620df0 | 419 | # endif |
78340847 VZ |
420 | |
421 | /* Place other OS/2 compiler environment defines here */ | |
ef620df0 | 422 | # if defined(__VISAGECPP__) |
78340847 | 423 | /* VisualAge is the only thing that understands _Optlink */ |
ef620df0 VZ |
424 | # define LINKAGEMODE _Optlink |
425 | # endif | |
426 | # define wxSIZE_T_IS_UINT | |
c427acc8 | 427 | |
80da12bc DE |
428 | /* |
429 | OS: Palm OS | |
430 | */ | |
4055ed82 WS |
431 | #elif defined(__PALMOS__) |
432 | # ifdef __WIN32__ | |
433 | # error "__WIN32__ should not be defined for PalmOS" | |
434 | # endif | |
435 | # ifdef __WINDOWS__ | |
436 | # error "__WINDOWS__ should not be defined for PalmOS" | |
437 | # endif | |
438 | # ifdef __WXMSW__ | |
439 | # error "__WXMSW__ should not be defined for PalmOS" | |
440 | # endif | |
441 | ||
80da12bc DE |
442 | /* |
443 | OS: Otherwise it must be Windows | |
444 | */ | |
78340847 | 445 | #else /* Windows */ |
ef620df0 VZ |
446 | # ifndef __WINDOWS__ |
447 | # define __WINDOWS__ | |
448 | # endif /* Windows */ | |
78340847 VZ |
449 | |
450 | /* to be changed for Win64! */ | |
ef620df0 | 451 | # ifndef __WIN32__ |
3a5bcc4d | 452 | # error "__WIN32__ should be defined for Win32 and Win64, Win16 is not supported" |
ef620df0 | 453 | # endif |
78340847 VZ |
454 | |
455 | /* | |
456 | define another standard symbol for Microsoft Visual C++: the standard | |
457 | one (_MSC_VER) is also defined by Metrowerks compiler | |
458 | */ | |
ef620df0 VZ |
459 | # if defined(_MSC_VER) && !defined(__MWERKS__) |
460 | # define __VISUALC__ _MSC_VER | |
461 | # elif defined(__BCPLUSPLUS__) && !defined(__BORLANDC__) | |
462 | # define __BORLANDC__ | |
6d3d756a | 463 | # elif defined(__WATCOMC__) |
ef620df0 VZ |
464 | # elif defined(__SC__) |
465 | # define __SYMANTECC__ | |
466 | # endif /* compiler */ | |
78340847 VZ |
467 | |
468 | /* size_t is the same as unsigned int for all Windows compilers we know, */ | |
469 | /* so define it if it hadn't been done by configure yet */ | |
ef620df0 VZ |
470 | # if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG) |
471 | # define wxSIZE_T_IS_UINT | |
472 | # endif | |
78340847 VZ |
473 | #endif /* OS */ |
474 | ||
475 | /* | |
476 | if we're on a Unix system but didn't use configure (so that setup.h didn't | |
477 | define __UNIX__), do define __UNIX__ now | |
478 | */ | |
479 | #if !defined(__UNIX__) && defined(__UNIX_LIKE__) | |
ef620df0 | 480 | # define __UNIX__ |
78340847 VZ |
481 | #endif /* Unix */ |
482 | ||
f79bd02d | 483 | #if defined(__WXMOTIF__) || defined(__WXX11__) |
ef620df0 | 484 | # define __X__ |
78340847 VZ |
485 | #endif |
486 | ||
4b41ab26 | 487 | #ifdef __SC__ |
ef620df0 VZ |
488 | # ifdef __DMC__ |
489 | # define __DIGITALMARS__ | |
490 | # else | |
491 | # define __SYMANTEC__ | |
492 | # endif | |
4b41ab26 VS |
493 | #endif |
494 | ||
17a1ebd1 VZ |
495 | #ifdef __INTEL_COMPILER |
496 | # define __INTELC__ | |
497 | #endif | |
498 | ||
7eb00c80 VZ |
499 | /* |
500 | We get "Large Files (ILP32) not supported in strict ANSI mode." #error | |
501 | from HP-UX standard headers when compiling with g++ without this: | |
502 | */ | |
503 | #if defined(__HPUX__) && !defined(__STDC_EXT__) | |
504 | # define __STDC_EXT__ 1 | |
505 | #endif | |
506 | ||
a84d5f9d | 507 | /* Force linking against required libraries under Windows: */ |
eddb3250 VS |
508 | #ifdef __WXWINCE__ |
509 | # include "wx/msw/wince/libraries.h" | |
a84d5f9d MW |
510 | #elif defined __WINDOWS__ |
511 | # include "wx/msw/libraries.h" | |
eddb3250 VS |
512 | #endif |
513 | ||
44893b87 VZ |
514 | /* |
515 | This macro can be used to test the gcc version and can be used like this: | |
516 | ||
ef620df0 | 517 | # if wxCHECK_GCC_VERSION(3, 1) |
44893b87 | 518 | ... we have gcc 3.1 or later ... |
ef620df0 | 519 | # else |
44893b87 | 520 | ... no gcc at all or gcc < 3.1 ... |
ef620df0 | 521 | # endif |
44893b87 | 522 | */ |
49ca2a99 PC |
523 | #if defined(__GNUC__) && defined(__GNUC_MINOR__) |
524 | #define wxCHECK_GCC_VERSION( major, minor ) \ | |
525 | ( ( __GNUC__ > (major) ) \ | |
526 | || ( __GNUC__ == (major) && __GNUC_MINOR__ >= (minor) ) ) | |
527 | #else | |
528 | #define wxCHECK_GCC_VERSION( major, minor ) 0 | |
529 | #endif | |
44893b87 | 530 | |
459f812b SN |
531 | #if defined(__BORLANDC__) || (defined(__GNUC__) && __GNUC__ < 3) |
532 | #define wxNEEDS_CHARPP | |
533 | #endif | |
534 | ||
78340847 VZ |
535 | /* |
536 | This macro can be used to check that the version of mingw32 compiler is | |
537 | at least maj.min | |
538 | */ | |
a0be6908 | 539 | #if ( defined( __GNUWIN32__ ) || defined( __MINGW32__ ) || \ |
7275146d | 540 | ( defined( __CYGWIN__ ) && defined( __WINDOWS__ ) ) || \ |
6d3d756a | 541 | wxCHECK_WATCOM_VERSION(1,0) ) && \ |
a0be6908 | 542 | !defined(__DOS__) && \ |
cb7d7375 | 543 | !defined(__WXPM__) && \ |
a0be6908 WS |
544 | !defined(__WXMOTIF__) && \ |
545 | !defined(__WXGTK__) && \ | |
546 | !defined(__WXX11__) && \ | |
547 | !defined(__WXPALMOS__) | |
ef620df0 | 548 | # include "wx/msw/gccpriv.h" |
78340847 | 549 | #else |
ef620df0 VZ |
550 | # undef wxCHECK_W32API_VERSION |
551 | # define wxCHECK_W32API_VERSION(maj, min) (0) | |
78340847 VZ |
552 | #endif |
553 | ||
2686d933 VZ |
554 | /** |
555 | This is similar to wxCHECK_GCC_VERSION but for Sun CC compiler. | |
556 | */ | |
557 | #ifdef __SUNCC__ | |
558 | /* | |
559 | __SUNCC__ is 0xVRP where V is major version, R release and P patch level | |
560 | */ | |
561 | #define wxCHECK_SUNCC_VERSION(maj, min) (__SUNCC__ >= (((maj)<<8) | ((min)<<4))) | |
562 | #else | |
563 | #define wxCHECK_SUNCC_VERSION(maj, min) (0) | |
564 | #endif | |
565 | ||
1e3c12d7 | 566 | #if defined (__WXMSW__) |
ef620df0 VZ |
567 | # if !defined(__WATCOMC__) |
568 | # define wxHAVE_RAW_BITMAP | |
569 | # endif | |
1e3c12d7 | 570 | #endif |
bf978f96 | 571 | |
5ed63bf5 DE |
572 | /* |
573 | Handle Darwin gcc universal compilation. Don't do this in an Apple- | |
574 | specific case since no sane compiler should be defining either | |
575 | __BIG_ENDIAN__ or __LITTLE_ENDIAN__ unless it really is generating | |
576 | code that will be hosted on a machine with the appropriate endianness. | |
577 | If a compiler defines neither, assume the user or configure set | |
578 | WORDS_BIGENDIAN appropriately. | |
579 | */ | |
580 | #if defined(__BIG_ENDIAN__) | |
581 | # undef WORDS_BIGENDIAN | |
582 | # define WORDS_BIGENDIAN 1 | |
583 | #elif defined(__LITTLE_ENDIAN__) | |
584 | # undef WORDS_BIGENDIAN | |
585 | #elif defined(__WXMAC__) && !defined(WORDS_BIGENDIAN) | |
586 | /* According to Stefan even ancient Mac compilers defined __BIG_ENDIAN__ */ | |
587 | # warning "Compiling wxMac with probably wrong endianness" | |
01ebf752 JS |
588 | #endif |
589 | ||
d6f2a891 VZ |
590 | /* |
591 | check the consistency of the settings in setup.h: note that this must be | |
592 | done after setting wxUSE_UNICODE correctly as it is used in wx/chkconf.h | |
593 | and after defining the compiler macros which are used in it too | |
594 | */ | |
595 | #include "wx/chkconf.h" | |
596 | ||
597 | ||
598 | /* | |
599 | some compilers don't support iostream.h any longer, while some of theme | |
600 | are not updated with <iostream> yet, so override the users setting here | |
601 | in such case. | |
602 | */ | |
603 | #if defined(_MSC_VER) && (_MSC_VER >= 1310) | |
604 | # undef wxUSE_IOSTREAMH | |
605 | # define wxUSE_IOSTREAMH 0 | |
606 | #elif defined(__DMC__) || defined(__WATCOMC__) | |
607 | # undef wxUSE_IOSTREAMH | |
608 | # define wxUSE_IOSTREAMH 1 | |
609 | #elif defined(__MINGW32__) | |
610 | # undef wxUSE_IOSTREAMH | |
611 | # define wxUSE_IOSTREAMH 0 | |
612 | #endif /* compilers with/without iostream.h */ | |
613 | ||
614 | /* | |
615 | old C++ headers (like <iostream.h>) declare classes in the global namespace | |
616 | while the new, standard ones (like <iostream>) do it in std:: namespace, | |
617 | unless it's an old gcc version. | |
618 | ||
619 | using this macro allows constuctions like "wxSTD iostream" to work in | |
620 | either case | |
621 | */ | |
622 | #if !wxUSE_IOSTREAMH && (!defined(__GNUC__) || ( __GNUC__ > 2 ) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) | |
623 | # define wxSTD std:: | |
624 | #else | |
625 | # define wxSTD | |
626 | #endif | |
627 | ||
b6937696 JJ |
628 | /* On OpenVMS with the most recent HP C++ compiler some function (i.e. wscanf) |
629 | * are only available in the std-namespace. (BUG???) | |
630 | */ | |
631 | #if defined( __VMS ) && (__DECCXX_VER >= 70100000) && !defined(__STD_CFRONT) && !defined( __NONAMESPACE_STD ) | |
632 | # define wxVMS_USE_STD std:: | |
633 | #else | |
634 | # define wxVMS_USE_STD | |
635 | #endif | |
636 | ||
0b30bb0b JS |
637 | /* Choose which method we will use for updating menus |
638 | * - in OnIdle, or when we receive a wxEVT_MENU_OPEN event. | |
639 | * Presently, only Windows and GTK+ support wxEVT_MENU_OPEN. | |
640 | */ | |
641 | #ifndef wxUSE_IDLEMENUUPDATES | |
12c19488 | 642 | # if (defined(__WXMSW__) || defined(__WXGTK__)) && !defined(__WXUNIVERSAL__) |
ef620df0 VZ |
643 | # define wxUSE_IDLEMENUUPDATES 0 |
644 | # else | |
645 | # define wxUSE_IDLEMENUUPDATES 1 | |
646 | # endif | |
0b30bb0b JS |
647 | #endif |
648 | ||
5e967044 JS |
649 | /* |
650 | * Define symbols that are not yet in | |
651 | * configure or possibly some setup.h files. | |
652 | * They will need to be added. | |
653 | */ | |
654 | ||
655 | #ifndef wxUSE_FILECONFIG | |
ef620df0 VZ |
656 | # if wxUSE_CONFIG |
657 | # define wxUSE_FILECONFIG 1 | |
658 | # else | |
659 | # define wxUSE_FILECONFIG 0 | |
660 | # endif | |
5e967044 JS |
661 | #endif |
662 | ||
663 | #ifndef wxUSE_HOTKEY | |
ef620df0 | 664 | # define wxUSE_HOTKEY 0 |
5e967044 JS |
665 | #endif |
666 | ||
086b3a5b | 667 | #if !defined(wxUSE_WXDIB) && defined(__WXMSW__) |
ef620df0 | 668 | # define wxUSE_WXDIB 1 |
086b3a5b JS |
669 | #endif |
670 | ||
e40bae72 | 671 | /* |
4055ed82 | 672 | We need AvailabilityMacros.h for ifdefing out things that don't exist on |
e40bae72 RN |
673 | OSX 10.2 and lower |
674 | FIXME: We need a better way to detect for 10.3 then including a system header | |
675 | */ | |
676 | #ifdef __DARWIN__ | |
677 | #include <AvailabilityMacros.h> | |
678 | #endif | |
679 | ||
78340847 | 680 | #endif /* _WX_PLATFORM_H_ */ |