From ca79179c0a12a381b7ddef2c47aa805795456776 Mon Sep 17 00:00:00 2001 From: Bernardo Innocenti Date: Sun, 25 Jul 2004 02:32:22 +0200 Subject: [PATCH] system.h (bool, [...]): Don't redefine as preprocessor macros in C++. * system.h (bool, true, false): Don't redefine as preprocessor macros in C++. From-SVN: r85135 --- gcc/ChangeLog | 5 +++++ gcc/system.h | 26 ++++++++++++++++++-------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 19dae5d..f4c844f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-07-25 Bernardo Innocenti + + * system.h (bool, true, false): Don't redefine as preprocessor macros + in C++. + 2004-07-24 Roger Sayle * expmed.c (init_expmed): A signed modulus by a power of two is diff --git a/gcc/system.h b/gcc/system.h index dfc8b08..3411fc4 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -505,18 +505,28 @@ extern int snprintf (char *, size_t, const char *, ...); and even if it is, it is liable to be buggy. This must be after all inclusion of system headers, as some of them will mess us up. */ -#undef bool -#undef true -#undef false + #undef TRUE #undef FALSE -#define bool unsigned char -#define true 1 -#define false 0 +#ifdef __cplusplus + /* Obsolete. */ +# define TRUE true +# define FALSE false +#else /* !__cplusplus */ +# undef bool +# undef true +# undef false + +# define bool unsigned char +# define true 1 +# define false 0 + + /* Obsolete. */ +# define TRUE true +# define FALSE false +#endif /* !__cplusplus */ -#define TRUE true -#define FALSE false /* Some compilers do not allow the use of unsigned char in bitfields. */ #define BOOL_BITFIELD unsigned int -- 2.7.4