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:
@@ -174,12 +174,23 @@
|
|||||||
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
|
#ifdef __cplusplus
|
||||||
// support them
|
// define boolean constants: don't use true/false here as not all compilers
|
||||||
#undef TRUE
|
// support them
|
||||||
#undef FALSE
|
#undef TRUE
|
||||||
#define TRUE ((bool)1)
|
#undef FALSE
|
||||||
#define FALSE ((bool)0)
|
#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;
|
typedef short int WXTYPE;
|
||||||
|
|
||||||
|
@@ -60,12 +60,6 @@
|
|||||||
|
|
||||||
#include <winsock.h>
|
#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 */
|
/* if we use configure for MSW SOCKLEN_T will be already defined */
|
||||||
#ifndef SOCKLEN_T
|
#ifndef SOCKLEN_T
|
||||||
# define SOCKLEN_T int
|
# define SOCKLEN_T int
|
||||||
|
@@ -55,12 +55,6 @@
|
|||||||
|
|
||||||
#include <winsock.h>
|
#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
|
#ifdef _MSC_VER
|
||||||
# pragma warning(default:4115) /* named type definition in parentheses */
|
# pragma warning(default:4115) /* named type definition in parentheses */
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user