define true/false if the compiler doesn't have them

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18630 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2003-01-07 22:29:59 +00:00
parent 038305d008
commit 90b1d65f2f
2 changed files with 19 additions and 27 deletions

View File

@@ -19,6 +19,7 @@ All:
- Implemented alignment for wxGrid bool editor and renderer - Implemented alignment for wxGrid bool editor and renderer
- Support wxListCtrl columns alignment for all platforms and not just MSW - Support wxListCtrl columns alignment for all platforms and not just MSW
- Added wxDateSpan::operator==() and !=() (Lukasz Michalski) - Added wxDateSpan::operator==() and !=() (Lukasz Michalski)
- use true/false throughout the library instead of TRUE/FALSE
Unix: Unix:

View File

@@ -174,35 +174,26 @@
typedef unsigned int bool; typedef unsigned int bool;
#endif // bool #endif // bool
#ifdef __cplusplus // deal with TRUE/true stuff: we assume that if the compiler supports bool, it
// define boolean constants: don't use true/false here as not all compilers // supports true/false as well and that, OTOH, if it does _not_ support bool,
// support them but also redefine TRUE which could have been defined as 1 // it doesn't support these keywords (this is less sure, in particular VC++
// by previous headers: this would be incorrect as our TRUE is supposed to // 4.x could be a problem here)
// be of type bool, just like true, not int #ifndef HAVE_BOOL
// #define true ((bool)1)
// however if the user code absolutely needs TRUE to be defined in its own #define false ((bool)0)
// way, it can predefine WX_TRUE_DEFINED to prevent the redefinition here #endif
#ifdef TRUE
#ifndef WX_TRUE_DEFINED
#undef TRUE
#undef FALSE
#endif
#endif
#ifndef TRUE // for backwards compatibility, also define TRUE and FALSE
#define TRUE ((bool)1) //
#define FALSE ((bool)0) // note that these definitions should work both in C++ and C code, so don't
#endif // use true/false below
#else // !__cplusplus #ifndef TRUE
// the definitions above don't work for C sources #define TRUE 1
#ifndef TRUE #endif
#define TRUE 1
#endif
#ifndef FALSE #ifndef FALSE
#define FALSE 0 #define FALSE 0
#endif #endif
#endif // C++/!C++
typedef short int WXTYPE; typedef short int WXTYPE;