platform.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705
  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. * Copyright: (c) 1997-2001 Vadim Zeitlin
  8. * Licence: wxWindows licence
  9. */
  10. /* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */
  11. #ifndef _WX_PLATFORM_H_
  12. #define _WX_PLATFORM_H_
  13. #ifdef __WXMAC_XCODE__
  14. # include <unistd.h>
  15. # include <TargetConditionals.h>
  16. # include <AvailabilityMacros.h>
  17. # ifndef MAC_OS_X_VERSION_10_4
  18. # define MAC_OS_X_VERSION_10_4 1040
  19. # endif
  20. # ifndef MAC_OS_X_VERSION_10_5
  21. # define MAC_OS_X_VERSION_10_5 1050
  22. # endif
  23. # ifndef MAC_OS_X_VERSION_10_6
  24. # define MAC_OS_X_VERSION_10_6 1060
  25. # endif
  26. # ifndef MAC_OS_X_VERSION_10_7
  27. # define MAC_OS_X_VERSION_10_7 1070
  28. # endif
  29. # ifndef MAC_OS_X_VERSION_10_8
  30. # define MAC_OS_X_VERSION_10_8 1080
  31. # endif
  32. # include "wx/osx/config_xcode.h"
  33. # ifndef __WXOSX__
  34. # define __WXOSX__ 1
  35. # endif
  36. # ifndef __WXMAC__
  37. # define __WXMAC__ 1
  38. # endif
  39. #endif
  40. /*
  41. We use __WINDOWS__ as our main identification symbol for Microsoft Windows
  42. but it's actually not predefined directly by any commonly used compilers
  43. (only Watcom defines it itself and it's not supported any longer), so we
  44. define it ourselves if any of the following macros is defined:
  45. - MSVC _WIN32 (notice that this is also defined under Win64)
  46. - Borland __WIN32__
  47. - Our __WXMSW__ which selects Windows as platform automatically
  48. */
  49. #if defined(_WIN32) || defined(__WIN32__) || defined(__WXMSW__)
  50. # ifndef __WINDOWS__
  51. # define __WINDOWS__
  52. # endif /* !__WINDOWS__ */
  53. #endif /* Any standard symbol indicating Windows */
  54. #if defined(__WINDOWS__)
  55. /* Select wxMSW under Windows if no other port is specified. */
  56. # if !defined(__WXMSW__) && !defined(__WXMOTIF__) && !defined(__WXGTK__) && !defined(__WXX11__)
  57. # define __WXMSW__
  58. # endif
  59. # if !defined(__WINDOWS__)
  60. # define __WINDOWS__
  61. # endif
  62. # ifndef _WIN32
  63. # define _WIN32
  64. # endif
  65. # ifndef WIN32
  66. # define WIN32
  67. # endif
  68. # ifndef __WIN32__
  69. # define __WIN32__
  70. # endif
  71. /* MSVC predefines _WIN64 for 64 bit builds, for gcc we use generic
  72. architecture definitions. */
  73. # if defined(_WIN64) || defined(__x86_64__)
  74. # ifndef __WIN64__
  75. # define __WIN64__
  76. # endif /* !__WIN64__ */
  77. # endif /* _WIN64 */
  78. #endif /* __WINDOWS__ */
  79. /*
  80. Don't use widget toolkit specific code in non-GUI code in the library
  81. itself to ensure that the same base library is used for both MSW and GTK
  82. ports. But keep __WXMSW__ defined for (console) applications using
  83. wxWidgets for compatibility.
  84. */
  85. #if defined(WXBUILDING) && defined(wxUSE_GUI) && !wxUSE_GUI
  86. # ifdef __WXMSW__
  87. # undef __WXMSW__
  88. # endif
  89. # ifdef __WXGTK__
  90. # undef __WXGTK__
  91. # endif
  92. #endif
  93. #if defined(__WXGTK__) && defined(__WINDOWS__)
  94. # ifdef __WXMSW__
  95. # undef __WXMSW__
  96. # endif
  97. #endif /* __WXGTK__ && __WINDOWS__ */
  98. /* detect MS SmartPhone */
  99. #if defined( WIN32_PLATFORM_WFSP )
  100. # ifndef __SMARTPHONE__
  101. # define __SMARTPHONE__
  102. # endif
  103. # ifndef __WXWINCE__
  104. # define __WXWINCE__
  105. # endif
  106. #endif
  107. /* detect PocketPC */
  108. #if defined( WIN32_PLATFORM_PSPC )
  109. # ifndef __POCKETPC__
  110. # define __POCKETPC__
  111. # endif
  112. # ifndef __WXWINCE__
  113. # define __WXWINCE__
  114. # endif
  115. #endif
  116. /* detect Standard WinCE SDK */
  117. #if defined( WCE_PLATFORM_STANDARDSDK )
  118. # ifndef __WINCE_STANDARDSDK__
  119. # define __WINCE_STANDARDSDK__
  120. # endif
  121. # ifndef __WXWINCE__
  122. # define __WXWINCE__
  123. # endif
  124. #endif
  125. #if defined(_WIN32_WCE) && !defined(WIN32_PLATFORM_WFSP) && !defined(WIN32_PLATFORM_PSPC)
  126. # if (_WIN32_WCE >= 400)
  127. # ifndef __WINCE_NET__
  128. # define __WINCE_NET__
  129. # endif
  130. # elif (_WIN32_WCE >= 200)
  131. # ifndef __HANDHELDPC__
  132. # define __HANDHELDPC__
  133. # endif
  134. # endif
  135. # ifndef __WXWINCE__
  136. # define __WXWINCE__
  137. # endif
  138. #endif
  139. #if defined(__WXWINCE__) && defined(_MSC_VER) && (_MSC_VER == 1201)
  140. #define __EVC4__
  141. #endif
  142. #if defined(__POCKETPC__) || defined(__SMARTPHONE__) || defined(__WXGPE__)
  143. # define __WXHANDHELD__
  144. #endif
  145. #ifdef __ANDROID__
  146. # define __WXANDROID__
  147. # include "wx/android/config_android.h"
  148. #endif
  149. #include "wx/compiler.h"
  150. /*
  151. Include wx/setup.h for the Unix platform defines generated by configure and
  152. the library compilation options
  153. Note that it must be included before defining hardware symbols below as they
  154. could be already defined by configure but it must be included after defining
  155. the compiler macros above as msvc/wx/setup.h relies on them under Windows.
  156. */
  157. #include "wx/setup.h"
  158. /*
  159. Convenience for any optional classes that use the wxAnyButton base class.
  160. */
  161. #if wxUSE_TOGGLEBTN || wxUSE_BUTTON
  162. #define wxHAS_ANY_BUTTON
  163. #endif
  164. /*
  165. Hardware platform detection.
  166. VC++ defines _M_xxx symbols.
  167. */
  168. #if defined(_M_IX86) || defined(i386) || defined(__i386) || defined(__i386__)
  169. #ifndef __INTEL__
  170. #define __INTEL__
  171. #endif
  172. #endif /* x86 */
  173. #if defined(_M_IA64)
  174. #ifndef __IA64__
  175. #define __IA64__
  176. #endif
  177. #endif /* ia64 */
  178. #if defined(_M_MPPC) || defined(__PPC__) || defined(__ppc__)
  179. #ifndef __POWERPC__
  180. #define __POWERPC__
  181. #endif
  182. #endif /* alpha */
  183. #if defined(_M_ALPHA) || defined(__AXP__)
  184. #ifndef __ALPHA__
  185. #define __ALPHA__
  186. #endif
  187. #endif /* alpha */
  188. /*
  189. adjust the Unicode setting: wxUSE_UNICODE should be defined as 0 or 1
  190. and is used by wxWidgets, _UNICODE and/or UNICODE may be defined or used by
  191. the system headers so bring these settings in sync
  192. */
  193. /* set wxUSE_UNICODE to 1 if UNICODE or _UNICODE is defined */
  194. #if defined(_UNICODE) || defined(UNICODE)
  195. # undef wxUSE_UNICODE
  196. # define wxUSE_UNICODE 1
  197. #else /* !UNICODE */
  198. # ifndef wxUSE_UNICODE
  199. # define wxUSE_UNICODE 0
  200. # endif
  201. #endif /* UNICODE/!UNICODE */
  202. /* and vice versa: define UNICODE and _UNICODE if wxUSE_UNICODE is 1 */
  203. #if wxUSE_UNICODE
  204. # ifndef _UNICODE
  205. # define _UNICODE
  206. # endif
  207. # ifndef UNICODE
  208. # define UNICODE
  209. # endif
  210. #endif /* wxUSE_UNICODE */
  211. /*
  212. test for old versions of Borland C, normally need at least 5.82, Turbo
  213. explorer, available for free at http://www.turboexplorer.com/downloads
  214. */
  215. /*
  216. Older versions of Borland C have some compiler bugs that need
  217. workarounds. Mostly pertains to the free command line compiler 5.5.1.
  218. */
  219. #if defined(__BORLANDC__) && (__BORLANDC__ <= 0x551)
  220. /*
  221. The Borland free compiler is unable to handle overloaded enum
  222. comparisons under certain conditions e.g. when any class has a
  223. conversion ctor for an integral type and there's an overload to
  224. compare between an integral type and that class type.
  225. */
  226. # define wxCOMPILER_NO_OVERLOAD_ON_ENUM
  227. /*
  228. This is needed to overcome bugs in 5.5.1 STL, linking errors will
  229. result if it is not defined.
  230. */
  231. # define _RWSTD_COMPILE_INSTANTIATE
  232. /*
  233. Preprocessor in older Borland compilers have major problems
  234. concatenating with ##. Specifically, if the string operands being
  235. concatenated have special meaning (e.g. L"str", 123i64 etc)
  236. then ## will not concatenate the operands correctly.
  237. As a workaround, define wxPREPEND* and wxAPPEND* without using
  238. wxCONCAT_HELPER.
  239. */
  240. # define wxCOMPILER_BROKEN_CONCAT_OPER
  241. #endif /* __BORLANDC__ */
  242. /*
  243. OS: first of all, test for MS-DOS platform. We must do this before testing
  244. for Unix, because DJGPP compiler defines __unix__ under MS-DOS
  245. */
  246. #if defined(__GO32__) || defined(__DJGPP__) || defined(__DOS__)
  247. # ifndef __DOS__
  248. # define __DOS__
  249. # endif
  250. /* size_t is the same as unsigned int for Watcom 11 compiler, */
  251. /* so define it if it hadn't been done by configure yet */
  252. # if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG)
  253. # ifdef __WATCOMC__
  254. # define wxSIZE_T_IS_UINT
  255. # endif
  256. # ifdef __DJGPP__
  257. # define wxSIZE_T_IS_ULONG
  258. # endif
  259. # endif
  260. /*
  261. OS: then test for generic Unix defines, then for particular flavours and
  262. finally for Unix-like systems
  263. Mac OS X matches this case (__MACH__), prior Mac OS do not.
  264. */
  265. #elif defined(__UNIX__) || defined(__unix) || defined(__unix__) || \
  266. defined(____SVR4____) || defined(__LINUX__) || defined(__sgi) || \
  267. defined(__hpux) || defined(sun) || defined(__SUN__) || defined(_AIX) || \
  268. defined(__EMX__) || defined(__VMS) || defined(__BEOS__) || defined(__MACH__)
  269. # define __UNIX_LIKE__
  270. # ifdef __SGI__
  271. # ifdef __GNUG__
  272. # else /* !gcc */
  273. /*
  274. Note I use the term __SGI_CC__ for both cc and CC, its not a good
  275. idea to mix gcc and cc/CC, the name mangling is different
  276. */
  277. # define __SGI_CC__
  278. # endif /* gcc/!gcc */
  279. /* system headers use this symbol and not __cplusplus in some places */
  280. # ifndef _LANGUAGE_C_PLUS_PLUS
  281. # define _LANGUAGE_C_PLUS_PLUS
  282. # endif
  283. # endif /* SGI */
  284. # ifdef __EMX__
  285. # define OS2EMX_PLAIN_CHAR
  286. # endif
  287. # if defined(__INNOTEK_LIBC__)
  288. /* Ensure visibility of strnlen declaration */
  289. # define _GNU_SOURCE
  290. # endif
  291. /* define __HPUX__ for HP-UX where standard macro is __hpux */
  292. # if defined(__hpux) && !defined(__HPUX__)
  293. # define __HPUX__
  294. # endif /* HP-UX */
  295. /* All of these should already be defined by including configure-
  296. generated setup.h but we wish to support Xcode compilation without
  297. requiring the user to define these himself.
  298. */
  299. # if defined(__APPLE__) && defined(__MACH__)
  300. # ifndef __UNIX__
  301. # define __UNIX__ 1
  302. # endif
  303. # ifndef __BSD__
  304. # define __BSD__ 1
  305. # endif
  306. /* __DARWIN__ is our own define to mean OS X or pure Darwin */
  307. # ifndef __DARWIN__
  308. # define __DARWIN__ 1
  309. # endif
  310. /* NOTE: TARGET_CARBON is actually a 0/1 and must be 1 for OS X */
  311. # ifndef TARGET_CARBON
  312. # define TARGET_CARBON 1
  313. # endif
  314. /* OS X uses unsigned long size_t for both ILP32 and LP64 modes. */
  315. # if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG)
  316. # define wxSIZE_T_IS_ULONG
  317. # endif
  318. # endif
  319. /*
  320. OS: OS/2
  321. */
  322. #elif defined(__OS2__)
  323. /* wxOS2 vs. non wxOS2 ports on OS2 platform */
  324. # if !defined(__WXMOTIF__) && !defined(__WXGTK__) && !defined(__WXX11__)
  325. # ifndef __WXPM__
  326. # define __WXPM__
  327. # endif
  328. # endif
  329. # if defined(__IBMCPP__)
  330. # define __VISAGEAVER__ __IBMCPP__
  331. # endif
  332. /* Place other OS/2 compiler environment defines here */
  333. # if defined(__VISAGECPP__)
  334. /* VisualAge is the only thing that understands _Optlink */
  335. # define LINKAGEMODE _Optlink
  336. # endif
  337. # define wxSIZE_T_IS_UINT
  338. /*
  339. OS: Windows
  340. */
  341. #elif defined(__WINDOWS__)
  342. /* to be changed for Win64! */
  343. # ifndef __WIN32__
  344. # error "__WIN32__ should be defined for Win32 and Win64, Win16 is not supported"
  345. # endif
  346. /* size_t is the same as unsigned int for all Windows compilers we know, */
  347. /* so define it if it hadn't been done by configure yet */
  348. # if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG) && !defined(__WIN64__)
  349. # define wxSIZE_T_IS_UINT
  350. # endif
  351. #else
  352. # error "Unknown platform."
  353. #endif /* OS */
  354. /*
  355. if we're on a Unix system but didn't use configure (so that setup.h didn't
  356. define __UNIX__), do define __UNIX__ now
  357. */
  358. #if !defined(__UNIX__) && defined(__UNIX_LIKE__)
  359. # define __UNIX__
  360. #endif /* Unix */
  361. #if defined(__WXMOTIF__) || defined(__WXX11__)
  362. # define __X__
  363. #endif
  364. /*
  365. We get "Large Files (ILP32) not supported in strict ANSI mode." #error
  366. from HP-UX standard headers when compiling with g++ without this:
  367. */
  368. #if defined(__HPUX__) && !defined(__STDC_EXT__)
  369. # define __STDC_EXT__ 1
  370. #endif
  371. /* Force linking against required libraries under Windows: */
  372. #ifdef __WXWINCE__
  373. # include "wx/msw/wince/libraries.h"
  374. #elif defined __WINDOWS__
  375. # include "wx/msw/libraries.h"
  376. #endif
  377. #if defined(__BORLANDC__) || (defined(__GNUC__) && __GNUC__ < 3)
  378. #define wxNEEDS_CHARPP
  379. #endif
  380. /*
  381. Note that wx/msw/gccpriv.h must be included after defining UNICODE and
  382. _UNICODE macros as it includes _mingw.h which relies on them being set.
  383. */
  384. #if ( defined( __GNUWIN32__ ) || defined( __MINGW32__ ) || \
  385. ( defined( __CYGWIN__ ) && defined( __WINDOWS__ ) ) || \
  386. wxCHECK_WATCOM_VERSION(1,0) ) && \
  387. !defined(__DOS__) && \
  388. !defined(__WXPM__) && \
  389. !defined(__WXMOTIF__) && \
  390. !defined(__WXX11__)
  391. # include "wx/msw/gccpriv.h"
  392. #else
  393. # undef wxCHECK_W32API_VERSION
  394. # define wxCHECK_W32API_VERSION(maj, min) (0)
  395. # undef wxCHECK_MINGW32_VERSION
  396. # define wxCHECK_MINGW32_VERSION( major, minor ) (0)
  397. #endif
  398. /*
  399. Handle Darwin gcc universal compilation. Don't do this in an Apple-
  400. specific case since no sane compiler should be defining either
  401. __BIG_ENDIAN__ or __LITTLE_ENDIAN__ unless it really is generating
  402. code that will be hosted on a machine with the appropriate endianness.
  403. If a compiler defines neither, assume the user or configure set
  404. WORDS_BIGENDIAN appropriately.
  405. */
  406. #if defined(__BIG_ENDIAN__)
  407. # undef WORDS_BIGENDIAN
  408. # define WORDS_BIGENDIAN 1
  409. #elif defined(__LITTLE_ENDIAN__)
  410. # undef WORDS_BIGENDIAN
  411. #elif defined(__WXMAC__) && !defined(WORDS_BIGENDIAN)
  412. /* According to Stefan even ancient Mac compilers defined __BIG_ENDIAN__ */
  413. # warning "Compiling wxMac with probably wrong endianness"
  414. #endif
  415. /* also the 32/64 bit universal builds must be handled accordingly */
  416. #ifdef __DARWIN__
  417. # ifdef __LP64__
  418. # undef SIZEOF_VOID_P
  419. # undef SIZEOF_LONG
  420. # undef SIZEOF_SIZE_T
  421. # define SIZEOF_VOID_P 8
  422. # define SIZEOF_LONG 8
  423. # define SIZEOF_SIZE_T 8
  424. # else
  425. # undef SIZEOF_VOID_P
  426. # undef SIZEOF_LONG
  427. # undef SIZEOF_SIZE_T
  428. # define SIZEOF_VOID_P 4
  429. # define SIZEOF_LONG 4
  430. # define SIZEOF_SIZE_T 4
  431. # endif
  432. #endif
  433. /*
  434. Define various OS X symbols before including wx/chkconf.h which uses them.
  435. __WXOSX_MAC__ means Mac OS X, non embedded
  436. __WXOSX_IPHONE__ means OS X iPhone
  437. */
  438. /*
  439. Normally all of __WXOSX_XXX__, __WXOSX__ and __WXMAC__ are defined by
  440. configure but ensure that we also define them if configure was not used for
  441. whatever reason.
  442. The primary symbol remains __WXOSX_XXX__ one, __WXOSX__ exists to allow
  443. checking for any OS X port (Carbon and Cocoa) and __WXMAC__ is an old name
  444. for it.
  445. */
  446. #if defined(__WXOSX_CARBON__) || defined(__WXOSX_COCOA__) || defined(__WXOSX_IPHONE__)
  447. # ifndef __WXOSX__
  448. # define __WXOSX__ 1
  449. # endif
  450. # ifndef __WXMAC__
  451. # define __WXMAC__ 1
  452. # endif
  453. #endif
  454. #ifdef __WXOSX__
  455. /* setup precise defines according to sdk used */
  456. # include <TargetConditionals.h>
  457. # if defined(__WXOSX_IPHONE__)
  458. # if !( defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE )
  459. # error "incorrect SDK for an iPhone build"
  460. # endif
  461. # else
  462. # if wxUSE_GUI && !(defined(__WXOSX_CARBON__) || defined(__WXOSX_COCOA__))
  463. # error "one of __WXOSX_IPHONE__, __WXOSX_CARBON__ or __WXOSX_COCOA__ must be defined for the GUI build"
  464. # endif
  465. # if !( defined(TARGET_OS_MAC) && TARGET_OS_MAC )
  466. # error "incorrect SDK for a Mac OS X build"
  467. # endif
  468. # define __WXOSX_MAC__ 1
  469. # endif
  470. #endif
  471. #ifdef __WXOSX_MAC__
  472. # if defined(__MACH__)
  473. # include <AvailabilityMacros.h>
  474. # ifndef MAC_OS_X_VERSION_10_4
  475. # define MAC_OS_X_VERSION_10_4 1040
  476. # endif
  477. # ifndef MAC_OS_X_VERSION_10_5
  478. # define MAC_OS_X_VERSION_10_5 1050
  479. # endif
  480. # ifndef MAC_OS_X_VERSION_10_6
  481. # define MAC_OS_X_VERSION_10_6 1060
  482. # endif
  483. # ifndef MAC_OS_X_VERSION_10_7
  484. # define MAC_OS_X_VERSION_10_7 1070
  485. # endif
  486. # ifndef MAC_OS_X_VERSION_10_8
  487. # define MAC_OS_X_VERSION_10_8 1080
  488. # endif
  489. # else
  490. # error "only mach-o configurations are supported"
  491. # endif
  492. #endif
  493. /*
  494. __WXOSX_OR_COCOA__ is a common define to wxOSX (Carbon or Cocoa) and wxCocoa ports under OS X.
  495. DO NOT use this define in base library code. Although wxMac has its own
  496. private base library (and thus __WXOSX_OR_COCOA__,__WXMAC__ and related defines are
  497. valid there), wxCocoa shares its library with other ports like wxGTK and wxX11.
  498. To keep wx authors from screwing this up, only enable __WXOSX_OR_COCOA__ for wxCocoa when
  499. not compiling the base library. We determine this by first checking if
  500. wxUSE_BASE is not defined. If it is not defined, then we're not buildling
  501. the base library, and possibly not building wx at all (but actually building
  502. user code that's using wx). If it is defined then we must check to make sure
  503. it is not true. If it is true, we're building base.
  504. If you want it in the common darwin base library then use __DARWIN__. You
  505. can use any Darwin-available libraries like CoreFoundation but please avoid
  506. using OS X libraries like Carbon or CoreServices.
  507. */
  508. #if defined(__WXOSX__) || (defined(__WXCOCOA__) && (!defined(wxUSE_BASE) || !wxUSE_BASE))
  509. # define __WXOSX_OR_COCOA__ 1
  510. #endif
  511. /*
  512. check the consistency of the settings in setup.h: note that this must be
  513. done after setting wxUSE_UNICODE correctly as it is used in wx/chkconf.h
  514. and after defining the compiler macros which are used in it too
  515. */
  516. #include "wx/chkconf.h"
  517. /*
  518. some compilers don't support iostream.h any longer, while some of theme
  519. are not updated with <iostream> yet, so override the users setting here
  520. in such case.
  521. */
  522. #if defined(_MSC_VER) && (_MSC_VER >= 1310)
  523. # undef wxUSE_IOSTREAMH
  524. # define wxUSE_IOSTREAMH 0
  525. #elif defined(__DMC__) || defined(__WATCOMC__)
  526. # undef wxUSE_IOSTREAMH
  527. # define wxUSE_IOSTREAMH 1
  528. #elif defined(__MINGW32__)
  529. # undef wxUSE_IOSTREAMH
  530. # define wxUSE_IOSTREAMH 0
  531. #endif /* compilers with/without iostream.h */
  532. /*
  533. old C++ headers (like <iostream.h>) declare classes in the global namespace
  534. while the new, standard ones (like <iostream>) do it in std:: namespace,
  535. unless it's an old gcc version.
  536. using this macro allows constuctions like "wxSTD iostream" to work in
  537. either case
  538. */
  539. #if !wxUSE_IOSTREAMH && (!defined(__GNUC__) || ( __GNUC__ > 2 ) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
  540. # define wxSTD std::
  541. #else
  542. # define wxSTD
  543. #endif
  544. /* On OpenVMS with the most recent HP C++ compiler some function (i.e. wscanf)
  545. * are only available in the std-namespace. (BUG???)
  546. */
  547. #if defined( __VMS ) && (__DECCXX_VER >= 70100000) && !defined(__STD_CFRONT) && !defined( __NONAMESPACE_STD )
  548. # define wxVMS_USE_STD std::
  549. #else
  550. # define wxVMS_USE_STD
  551. #endif
  552. #ifdef __VMS
  553. #define XtDisplay XTDISPLAY
  554. #ifdef __WXMOTIF__
  555. #define XtParent XTPARENT
  556. #define XtScreen XTSCREEN
  557. #define XtWindow XTWINDOW
  558. #endif
  559. #endif
  560. /* Choose which method we will use for updating menus
  561. * - in OnIdle, or when we receive a wxEVT_MENU_OPEN event.
  562. * Presently, only Windows, OS X and GTK+ support wxEVT_MENU_OPEN.
  563. */
  564. #ifndef wxUSE_IDLEMENUUPDATES
  565. # if (defined(__WXMSW__) || defined(__WXGTK__) || defined(__WXOSX__)) && !defined(__WXUNIVERSAL__)
  566. # define wxUSE_IDLEMENUUPDATES 0
  567. # else
  568. # define wxUSE_IDLEMENUUPDATES 1
  569. # endif
  570. #endif
  571. /*
  572. * Define symbols that are not yet in
  573. * configure or possibly some setup.h files.
  574. * They will need to be added.
  575. */
  576. #ifndef wxUSE_FILECONFIG
  577. # if wxUSE_CONFIG && wxUSE_TEXTFILE
  578. # define wxUSE_FILECONFIG 1
  579. # else
  580. # define wxUSE_FILECONFIG 0
  581. # endif
  582. #endif
  583. #ifndef wxUSE_HOTKEY
  584. # define wxUSE_HOTKEY 0
  585. #endif
  586. #if !defined(wxUSE_WXDIB) && defined(__WXMSW__)
  587. # define wxUSE_WXDIB 1
  588. #endif
  589. /*
  590. Optionally supported C++ features.
  591. */
  592. /*
  593. RTTI: if it is disabled in build/msw/makefile.* then this symbol will
  594. already be defined but it's also possible to do it from configure (with
  595. g++) or by editing project files with MSVC so test for it here too.
  596. */
  597. #ifndef wxNO_RTTI
  598. /*
  599. Only 4.3 defines __GXX_RTTI by default so its absence is not an
  600. indication of disabled RTTI with the previous versions.
  601. */
  602. # if wxCHECK_GCC_VERSION(4, 3)
  603. # ifndef __GXX_RTTI
  604. # define wxNO_RTTI
  605. # endif
  606. # elif defined(_MSC_VER)
  607. # ifndef _CPPRTTI
  608. # define wxNO_RTTI
  609. # endif
  610. # endif
  611. #endif /* wxNO_RTTI */
  612. #endif /* _WX_PLATFORM_H_ */