redefined TRUE and FALSE to be of type bool
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15145 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -28,6 +28,11 @@ wxBase:
|
|||||||
|
|
||||||
- small change to wxStopWatch::Pause() semantics, please see the documentation
|
- small change to wxStopWatch::Pause() semantics, please see the documentation
|
||||||
|
|
||||||
|
- unlikely but possible incompatibility: the definition of TRUE has changed
|
||||||
|
from "1" to "(bool)1" (and the same thing for FALSE), so the code which
|
||||||
|
could be erroneously compiled previously such as doing "return FALSE" from
|
||||||
|
a function returning a pointer would stop compiling now (but this change
|
||||||
|
is not supposed to have any effects on valid code)
|
||||||
|
|
||||||
All (GUI):
|
All (GUI):
|
||||||
|
|
||||||
|
@@ -127,15 +127,6 @@
|
|||||||
// check for native bool type and TRUE/FALSE constants
|
// check for native bool type and TRUE/FALSE constants
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// define boolean constants if not done yet
|
|
||||||
#ifndef TRUE
|
|
||||||
#define TRUE 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef FALSE
|
|
||||||
#define FALSE 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Add more tests here for Windows compilers that already define bool
|
// Add more tests here for Windows compilers that already define bool
|
||||||
// (under Unix, configure tests for this)
|
// (under Unix, configure tests for this)
|
||||||
#ifndef HAVE_BOOL
|
#ifndef HAVE_BOOL
|
||||||
@@ -180,9 +171,16 @@
|
|||||||
// NB: of course, this doesn't replace the standard type, because, for
|
// NB: of course, this doesn't replace the standard type, because, for
|
||||||
// example, overloading based on bool/int parameter doesn't work and
|
// example, overloading based on bool/int parameter doesn't work and
|
||||||
// so should be avoided in portable programs
|
// so should be avoided in portable programs
|
||||||
typedef unsigned int bool;
|
typedef unsigned int bool;
|
||||||
#endif // 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)
|
||||||
|
|
||||||
typedef short int WXTYPE;
|
typedef short int WXTYPE;
|
||||||
|
|
||||||
// special care should be taken with this type under Windows where the real
|
// special care should be taken with this type under Windows where the real
|
||||||
@@ -196,17 +194,16 @@ typedef int wxWindowID;
|
|||||||
// other feature tests
|
// other feature tests
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// Every ride down a slippery slope begins with a single step..
|
// Every ride down a slippery slope begins with a single step..
|
||||||
//
|
//
|
||||||
// Yes, using nested classes is indeed against our coding standards in
|
// Yes, using nested classes is indeed against our coding standards in
|
||||||
// general, but there are places where you can use them to advantage
|
// general, but there are places where you can use them to advantage
|
||||||
// without totally breaking ports that cannot use them. If you do, then
|
// without totally breaking ports that cannot use them. If you do, then
|
||||||
// wrap it in this guard, but such cases should still be relatively rare.
|
// wrap it in this guard, but such cases should still be relatively rare.
|
||||||
|
|
||||||
#ifndef __WIN16__
|
#ifndef __WIN16__
|
||||||
#define wxUSE_NESTED_CLASSES 1
|
#define wxUSE_NESTED_CLASSES 1
|
||||||
#else
|
#else
|
||||||
#define wxUSE_NESTED_CLASSES 0
|
#define wxUSE_NESTED_CLASSES 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user