This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
C++ bootstrap (part 4/n): Don't redefine bool, true and false inC++
- From: Bernardo Innocenti <bernie at develer dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 25 Jul 2004 02:33:52 +0200
- Subject: C++ bootstrap (part 4/n): Don't redefine bool, true and false inC++
- Organization: Develer S.r.l.
Hello,
This avoids redefining bool, true and false for C++. TRUE and FALSE
are still kept for backwards comptibility (maybe I could kill them in
a followup patch).
2004-07-25 Bernardo Innocenti <bernie@develer.com>
* system.h (bool, true, false): Don't redefine as preprocessor macros
in C++.
diff -u -p -r1.216 system.h
--- gcc/system.h 24 Jun 2004 12:09:41 -0000 1.216
+++ gcc/system.h 11 Jul 2004 23:58:52 -0000
@@ -501,18 +501,28 @@ extern int snprintf (char *, size_t, con
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
--
// Bernardo Innocenti - Develer S.r.l., R&D dept.
\X/ http://www.develer.com/