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;

View File

@@ -60,12 +60,6 @@
#include <winsock.h>
/* don't use C++ TRUE/FALSE definition which we get from wx/defs.h */
#undef TRUE
#undef FALSE
#define TRUE 1
#define FALSE 0
/* if we use configure for MSW SOCKLEN_T will be already defined */
#ifndef SOCKLEN_T
# define SOCKLEN_T int

View File

@@ -55,12 +55,6 @@
#include <winsock.h>
/* don't use C++ TRUE/FALSE definition which we get from wx/defs.h */
#undef TRUE
#undef FALSE
#define TRUE 1
#define FALSE 0
#ifdef _MSC_VER
# pragma warning(default:4115) /* named type definition in parentheses */
#endif