added WX_TRUE_DEFINED to allow preventing the redefinition of TRUE/FALSE

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15324 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-05-01 16:20:49 +00:00
parent c7f3eecc52
commit ad95fe268a

View File

@@ -176,11 +176,20 @@
#ifdef __cplusplus #ifdef __cplusplus
// define boolean constants: don't use true/false here as not all compilers // define boolean constants: don't use true/false here as not all compilers
// support them // support them but also redefine TRUE which could have been defined as 1
#undef TRUE // by previous headers: this would be incorrect as our TRUE is supposed to
#undef FALSE // be of type bool, just like true, not int
#define TRUE ((bool)1) //
#define FALSE ((bool)0) // however if the user code absolutely needs TRUE to be defined in its own
// way, it can predefine WX_TRUE_DEFINED to prevent the redefinition here
#ifdef TRUE
#ifndef WX_TRUE_DEFINED
#undef TRUE
#undef FALSE
#define TRUE ((bool)1)
#define FALSE ((bool)0)
#endif
#endif
#else // !__cplusplus #else // !__cplusplus
// the definitions above don't work for C sources // the definitions above don't work for C sources
#ifndef TRUE #ifndef TRUE