chkconf.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  1. /*
  2. * Name: wx/msw/chkconf.h
  3. * Purpose: Compiler-specific configuration checking
  4. * Author: Julian Smart
  5. * Modified by:
  6. * Created: 01/02/97
  7. * Copyright: (c) Julian Smart
  8. * Licence: wxWindows licence
  9. */
  10. /* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */
  11. #ifndef _WX_MSW_CHKCONF_H_
  12. #define _WX_MSW_CHKCONF_H_
  13. /* ensure that MSW-specific settings are defined */
  14. #ifndef wxUSE_ACTIVEX
  15. # ifdef wxABORT_ON_CONFIG_ERROR
  16. # error "wxUSE_ACTIVEX must be defined."
  17. # else
  18. # define wxUSE_ACTIVEX 0
  19. # endif
  20. #endif /* !defined(wxUSE_ACTIVEX) */
  21. #ifndef wxUSE_CRASHREPORT
  22. # ifdef wxABORT_ON_CONFIG_ERROR
  23. # error "wxUSE_CRASHREPORT must be defined."
  24. # else
  25. # define wxUSE_CRASHREPORT 0
  26. # endif
  27. #endif /* !defined(wxUSE_CRASHREPORT) */
  28. #ifndef wxUSE_DC_CACHEING
  29. # ifdef wxABORT_ON_CONFIG_ERROR
  30. # error "wxUSE_DC_CACHEING must be defined"
  31. # else
  32. # define wxUSE_DC_CACHEING 1
  33. # endif
  34. #endif /* wxUSE_DC_CACHEING */
  35. #ifndef wxUSE_DIALUP_MANAGER
  36. # ifdef wxABORT_ON_CONFIG_ERROR
  37. # error "wxUSE_DIALUP_MANAGER must be defined."
  38. # else
  39. # define wxUSE_DIALUP_MANAGER 0
  40. # endif
  41. #endif /* !defined(wxUSE_DIALUP_MANAGER) */
  42. #ifndef wxUSE_MS_HTML_HELP
  43. # ifdef wxABORT_ON_CONFIG_ERROR
  44. # error "wxUSE_MS_HTML_HELP must be defined."
  45. # else
  46. # define wxUSE_MS_HTML_HELP 0
  47. # endif
  48. #endif /* !defined(wxUSE_MS_HTML_HELP) */
  49. #ifndef wxUSE_INICONF
  50. # ifdef wxABORT_ON_CONFIG_ERROR
  51. # error "wxUSE_INICONF must be defined."
  52. # else
  53. # define wxUSE_INICONF 0
  54. # endif
  55. #endif /* !defined(wxUSE_INICONF) */
  56. #ifndef wxUSE_OLE
  57. # ifdef wxABORT_ON_CONFIG_ERROR
  58. # error "wxUSE_OLE must be defined."
  59. # else
  60. # define wxUSE_OLE 0
  61. # endif
  62. #endif /* !defined(wxUSE_OLE) */
  63. #ifndef wxUSE_OLE_AUTOMATION
  64. # ifdef wxABORT_ON_CONFIG_ERROR
  65. # error "wxUSE_OLE_AUTOMATION must be defined."
  66. # else
  67. # define wxUSE_OLE_AUTOMATION 0
  68. # endif
  69. #endif /* !defined(wxUSE_OLE_AUTOMATION) */
  70. #ifndef wxUSE_TASKBARICON_BALLOONS
  71. # ifdef wxABORT_ON_CONFIG_ERROR
  72. # error "wxUSE_TASKBARICON_BALLOONS must be defined."
  73. # else
  74. # define wxUSE_TASKBARICON_BALLOONS 0
  75. # endif
  76. #endif /* wxUSE_TASKBARICON_BALLOONS */
  77. #ifndef wxUSE_UNICODE_MSLU
  78. # ifdef wxABORT_ON_CONFIG_ERROR
  79. # error "wxUSE_UNICODE_MSLU must be defined."
  80. # else
  81. # define wxUSE_UNICODE_MSLU 0
  82. # endif
  83. #endif /* wxUSE_UNICODE_MSLU */
  84. #ifndef wxUSE_UXTHEME
  85. # ifdef wxABORT_ON_CONFIG_ERROR
  86. # error "wxUSE_UXTHEME must be defined."
  87. # else
  88. # define wxUSE_UXTHEME 0
  89. # endif
  90. #endif /* wxUSE_UXTHEME */
  91. /*
  92. * We don't want to give an error if wxUSE_UNICODE_MSLU is enabled but
  93. * wxUSE_UNICODE is not as this would make it impossible to simply set the
  94. * former in wx/setup.h as then the library wouldn't compile in non-Unicode
  95. * configurations, so instead simply unset it silently when it doesn't make
  96. * sense.
  97. */
  98. #if wxUSE_UNICODE_MSLU && !wxUSE_UNICODE
  99. # undef wxUSE_UNICODE_MSLU
  100. # define wxUSE_UNICODE_MSLU 0
  101. #endif
  102. /*
  103. * Unfortunately we can't use compiler TLS support if the library can be used
  104. * inside a dynamically loaded DLL under Windows XP, as this can result in hard
  105. * to diagnose crashes due to the bugs in Windows TLS support, see #13116.
  106. *
  107. * So we disable it unless we can be certain that the code will never run under
  108. * XP, as is the case if we're using a compiler which doesn't support XP such
  109. * as MSVC 11+, unless it's used with the special "_xp" toolset, in which case
  110. * _USING_V110_SDK71_ is defined.
  111. *
  112. * However defining wxUSE_COMPILER_TLS as 2 overrides this safety check, see
  113. * the comments in wx/setup.h.
  114. */
  115. #if wxUSE_COMPILER_TLS == 1
  116. #if !wxCHECK_VISUALC_VERSION(11) || defined(_USING_V110_SDK71_)
  117. #undef wxUSE_COMPILER_TLS
  118. #define wxUSE_COMPILER_TLS 0
  119. #endif
  120. #endif
  121. /*
  122. * disable the settings which don't work for some compilers
  123. */
  124. #ifndef wxUSE_NORLANDER_HEADERS
  125. # if ( wxCHECK_WATCOM_VERSION(1,0) || defined(__WINE__) ) || \
  126. ((defined(__MINGW32__) || defined(__CYGWIN__)) && ((__GNUC__>2) ||((__GNUC__==2) && (__GNUC_MINOR__>=95))))
  127. # define wxUSE_NORLANDER_HEADERS 1
  128. # else
  129. # define wxUSE_NORLANDER_HEADERS 0
  130. # endif
  131. #endif
  132. /*
  133. * See WINVER definition in wx/msw/wrapwin.h for the explanation of this test
  134. * logic.
  135. */
  136. #if (defined(__VISUALC__) && (__VISUALC__ < 1300)) && \
  137. (!defined(WINVER) || WINVER < 0x0500)
  138. # undef wxUSE_TASKBARICON_BALLOONS
  139. # define wxUSE_TASKBARICON_BALLOONS 0
  140. #endif
  141. /*
  142. * All of the settings below require SEH support (__try/__catch) and can't work
  143. * without it.
  144. */
  145. #if !defined(_MSC_VER) && \
  146. (!defined(__BORLANDC__) || __BORLANDC__ < 0x0550)
  147. # undef wxUSE_ON_FATAL_EXCEPTION
  148. # define wxUSE_ON_FATAL_EXCEPTION 0
  149. # undef wxUSE_CRASHREPORT
  150. # define wxUSE_CRASHREPORT 0
  151. # undef wxUSE_STACKWALKER
  152. # define wxUSE_STACKWALKER 0
  153. #endif /* compiler doesn't support SEH */
  154. #if defined(__GNUWIN32__)
  155. /* These don't work as expected for mingw32 and cygwin32 */
  156. # undef wxUSE_MEMORY_TRACING
  157. # define wxUSE_MEMORY_TRACING 0
  158. # undef wxUSE_GLOBAL_MEMORY_OPERATORS
  159. # define wxUSE_GLOBAL_MEMORY_OPERATORS 0
  160. # undef wxUSE_DEBUG_NEW_ALWAYS
  161. # define wxUSE_DEBUG_NEW_ALWAYS 0
  162. /* some Cygwin versions don't have wcslen */
  163. # if defined(__CYGWIN__) || defined(__CYGWIN32__)
  164. # if ! ((__GNUC__>2) ||((__GNUC__==2) && (__GNUC_MINOR__>=95)))
  165. # undef wxUSE_WCHAR_T
  166. # define wxUSE_WCHAR_T 0
  167. # endif
  168. #endif
  169. #endif /* __GNUWIN32__ */
  170. /* wxUSE_MFC is not defined when using configure as it doesn't make sense for
  171. gcc or mingw32 anyhow */
  172. #ifndef wxUSE_MFC
  173. #define wxUSE_MFC 0
  174. #endif /* !defined(wxUSE_MFC) */
  175. /* MFC duplicates these operators */
  176. #if wxUSE_MFC
  177. # undef wxUSE_GLOBAL_MEMORY_OPERATORS
  178. # define wxUSE_GLOBAL_MEMORY_OPERATORS 0
  179. # undef wxUSE_DEBUG_NEW_ALWAYS
  180. # define wxUSE_DEBUG_NEW_ALWAYS 0
  181. #endif /* wxUSE_MFC */
  182. #if (defined(__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS)
  183. /* GnuWin32 doesn't have appropriate headers for e.g. IUnknown. */
  184. # undef wxUSE_DRAG_AND_DROP
  185. # define wxUSE_DRAG_AND_DROP 0
  186. #endif
  187. #if !wxUSE_OWNER_DRAWN && !defined(__WXUNIVERSAL__)
  188. # undef wxUSE_CHECKLISTBOX
  189. # define wxUSE_CHECKLISTBOX 0
  190. #endif
  191. #if wxUSE_SPINCTRL
  192. # if !wxUSE_SPINBTN
  193. # ifdef wxABORT_ON_CONFIG_ERROR
  194. # error "wxSpinCtrl requires wxSpinButton on MSW"
  195. # else
  196. # undef wxUSE_SPINBTN
  197. # define wxUSE_SPINBTN 1
  198. # endif
  199. # endif
  200. #endif
  201. /*
  202. Win64-specific checks.
  203. */
  204. #ifdef __WIN64__
  205. # if wxUSE_STACKWALKER
  206. # undef wxUSE_CRASHREPORT
  207. # define wxUSE_CRASHREPORT 0
  208. # endif
  209. #endif /* __WIN64__ */
  210. /*
  211. Compiler-specific checks.
  212. */
  213. /* Borland */
  214. #ifdef __BORLANDC__
  215. #if __BORLANDC__ < 0x500
  216. /* BC++ 4.0 can't compile JPEG library */
  217. # undef wxUSE_LIBJPEG
  218. # define wxUSE_LIBJPEG 0
  219. #endif
  220. /* wxUSE_DEBUG_NEW_ALWAYS = 1 not compatible with BC++ in DLL mode */
  221. #if defined(WXMAKINGDLL) || defined(WXUSINGDLL)
  222. # undef wxUSE_DEBUG_NEW_ALWAYS
  223. # define wxUSE_DEBUG_NEW_ALWAYS 0
  224. #endif
  225. #endif /* __BORLANDC__ */
  226. /* DMC++ doesn't have definitions for date picker control, so use generic control
  227. */
  228. #ifdef __DMC__
  229. # if wxUSE_DATEPICKCTRL
  230. # undef wxUSE_DATEPICKCTRL_GENERIC
  231. # undef wxUSE_DATEPICKCTRL
  232. # endif
  233. # define wxUSE_DATEPICKCTRL 0
  234. # define wxUSE_DATEPICKCTRL_GENERIC 1
  235. #endif
  236. /*
  237. un/redefine the options which we can't compile (after checking that they're
  238. defined
  239. */
  240. #ifdef __WINE__
  241. # if wxUSE_ACTIVEX
  242. # undef wxUSE_ACTIVEX
  243. # define wxUSE_ACTIVEX 0
  244. # endif /* wxUSE_ACTIVEX */
  245. # if wxUSE_UNICODE_MSLU
  246. # undef wxUSE_UNICODE_MSLU
  247. # define wxUSE_UNICODE_MSLU 0
  248. # endif /* wxUSE_UNICODE_MSLU */
  249. #endif /* __WINE__ */
  250. /* check settings consistency for MSW-specific ones */
  251. #if wxUSE_CRASHREPORT && !wxUSE_ON_FATAL_EXCEPTION
  252. # ifdef wxABORT_ON_CONFIG_ERROR
  253. # error "wxUSE_CRASHREPORT requires wxUSE_ON_FATAL_EXCEPTION"
  254. # else
  255. # undef wxUSE_CRASHREPORT
  256. # define wxUSE_CRASHREPORT 0
  257. # endif
  258. #endif /* wxUSE_CRASHREPORT */
  259. #if !wxUSE_VARIANT
  260. # if wxUSE_ACTIVEX
  261. # ifdef wxABORT_ON_CONFIG_ERROR
  262. # error "wxActiveXContainer requires wxVariant"
  263. # else
  264. # undef wxUSE_ACTIVEX
  265. # define wxUSE_ACTIVEX 0
  266. # endif
  267. # endif
  268. # if wxUSE_OLE_AUTOMATION
  269. # ifdef wxABORT_ON_CONFIG_ERROR
  270. # error "wxAutomationObject requires wxVariant"
  271. # else
  272. # undef wxUSE_OLE_AUTOMATION
  273. # define wxUSE_OLE_AUTOMATION 0
  274. # endif
  275. # endif
  276. #endif /* !wxUSE_VARIANT */
  277. #if !wxUSE_DYNAMIC_LOADER
  278. # if wxUSE_MS_HTML_HELP
  279. # ifdef wxABORT_ON_CONFIG_ERROR
  280. # error "wxUSE_MS_HTML_HELP requires wxUSE_DYNAMIC_LOADER."
  281. # else
  282. # undef wxUSE_MS_HTML_HELP
  283. # define wxUSE_MS_HTML_HELP 0
  284. # endif
  285. # endif
  286. # if wxUSE_DIALUP_MANAGER
  287. # ifdef wxABORT_ON_CONFIG_ERROR
  288. # error "wxUSE_DIALUP_MANAGER requires wxUSE_DYNAMIC_LOADER."
  289. # else
  290. # undef wxUSE_DIALUP_MANAGER
  291. # define wxUSE_DIALUP_MANAGER 0
  292. # endif
  293. # endif
  294. #endif /* !wxUSE_DYNAMIC_LOADER */
  295. #if !wxUSE_DYNLIB_CLASS
  296. # if wxUSE_DC_TRANSFORM_MATRIX
  297. # ifdef wxABORT_ON_CONFIG_ERROR
  298. # error "wxUSE_DC_TRANSFORM_MATRIX requires wxUSE_DYNLIB_CLASS"
  299. # else
  300. # undef wxUSE_DC_TRANSFORM_MATRIX
  301. # define wxUSE_DC_TRANSFORM_MATRIX 0
  302. # endif
  303. # endif
  304. # if wxUSE_UXTHEME
  305. # ifdef wxABORT_ON_CONFIG_ERROR
  306. # error "wxUSE_UXTHEME requires wxUSE_DYNLIB_CLASS"
  307. # else
  308. # undef wxUSE_UXTHEME
  309. # define wxUSE_UXTHEME 0
  310. # endif
  311. # endif
  312. # if wxUSE_MEDIACTRL
  313. # ifdef wxABORT_ON_CONFIG_ERROR
  314. # error "wxUSE_MEDIACTRL requires wxUSE_DYNLIB_CLASS"
  315. # else
  316. # undef wxUSE_MEDIACTRL
  317. # define wxUSE_MEDIACTRL 0
  318. # endif
  319. # endif
  320. # if wxUSE_INKEDIT
  321. # ifdef wxABORT_ON_CONFIG_ERROR
  322. # error "wxUSE_INKEDIT requires wxUSE_DYNLIB_CLASS"
  323. # else
  324. # undef wxUSE_INKEDIT
  325. # define wxUSE_INKEDIT 0
  326. # endif
  327. # endif
  328. #endif /* !wxUSE_DYNLIB_CLASS */
  329. #if !wxUSE_OLE
  330. # if wxUSE_ACTIVEX
  331. # ifdef wxABORT_ON_CONFIG_ERROR
  332. # error "wxActiveXContainer requires wxUSE_OLE"
  333. # else
  334. # undef wxUSE_ACTIVEX
  335. # define wxUSE_ACTIVEX 0
  336. # endif
  337. # endif
  338. # if wxUSE_DATAOBJ
  339. # ifdef wxABORT_ON_CONFIG_ERROR
  340. # error "wxUSE_DATAOBJ requires wxUSE_OLE"
  341. # else
  342. # undef wxUSE_DATAOBJ
  343. # define wxUSE_DATAOBJ 0
  344. # endif
  345. # endif
  346. # if wxUSE_OLE_AUTOMATION
  347. # ifdef wxABORT_ON_CONFIG_ERROR
  348. # error "wxAutomationObject requires wxUSE_OLE"
  349. # else
  350. # undef wxUSE_OLE_AUTOMATION
  351. # define wxUSE_OLE_AUTOMATION 0
  352. # endif
  353. # endif
  354. #endif /* !wxUSE_OLE */
  355. #if !wxUSE_ACTIVEX
  356. # if wxUSE_MEDIACTRL
  357. # ifdef wxABORT_ON_CONFIG_ERROR
  358. # error "wxMediaCtl requires wxActiveXContainer"
  359. # else
  360. # undef wxUSE_MEDIACTRL
  361. # define wxUSE_MEDIACTRL 0
  362. # endif
  363. # endif
  364. # if wxUSE_WEB
  365. # ifdef wxABORT_ON_CONFIG_ERROR
  366. # error "wxWebView requires wxActiveXContainer under MSW"
  367. # else
  368. # undef wxUSE_WEB
  369. # define wxUSE_WEB 0
  370. # endif
  371. # endif
  372. #endif /* !wxUSE_ACTIVEX */
  373. #if !wxUSE_THREADS
  374. # if wxUSE_FSWATCHER
  375. # ifdef wxABORT_ON_CONFIG_ERROR
  376. # error "wxFileSystemWatcher requires wxThread under MSW"
  377. # else
  378. # undef wxUSE_FSWATCHER
  379. # define wxUSE_FSWATCHER 0
  380. # endif
  381. # endif
  382. #endif /* !wxUSE_THREADS */
  383. #if !wxUSE_OLE_AUTOMATION
  384. # if wxUSE_WEB
  385. # ifdef wxABORT_ON_CONFIG_ERROR
  386. # error "wxWebView requires wxUSE_OLE_AUTOMATION under MSW"
  387. # else
  388. # undef wxUSE_WEB
  389. # define wxUSE_WEB 0
  390. # endif
  391. # endif
  392. #endif /* !wxUSE_OLE_AUTOMATION */
  393. #if defined(__WXUNIVERSAL__) && wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW && !wxUSE_POSTSCRIPT
  394. # undef wxUSE_POSTSCRIPT
  395. # define wxUSE_POSTSCRIPT 1
  396. #endif
  397. #endif /* _WX_MSW_CHKCONF_H_ */