better, more generic and backwards compatible, fix for TRUE/FALSE in C code

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15156 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-04-16 07:43:04 +00:00
parent 009fead004
commit 691aba016b
3 changed files with 17 additions and 18 deletions

View File

@@ -174,12 +174,23 @@
typedef unsigned int bool;
#endif // bool
// define boolean constants: don't use true/false here as not all compilers
// support them
#undef TRUE
#undef FALSE
#define TRUE ((bool)1)
#define FALSE ((bool)0)
#ifdef __cplusplus
// define boolean constants: don't use true/false here as not all compilers
// support them
#undef TRUE
#undef FALSE
#define TRUE ((bool)1)
#define FALSE ((bool)0)
#else // !__cplusplus
// the definitions above don't work for C sources
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#endif // C++/!C++
typedef short int WXTYPE;