* ginclude/stdbool.h: Support compilation as C++.
authorMartin v. Löwis <loewis@informatik.hu-berlin.de>
Tue, 4 Jan 2000 10:12:22 +0000 (10:12 +0000)
committerMartin v. Löwis <loewis@gcc.gnu.org>
Tue, 4 Jan 2000 10:12:22 +0000 (10:12 +0000)
From-SVN: r31201

gcc/ChangeLog
gcc/ginclude/stdbool.h

index 3d05611..0b25b55 100644 (file)
@@ -1,3 +1,7 @@
+2000-01-04  Martin von Löwis  <loewis@informatik.hu-berlin.de>
+
+       * ginclude/stdbool.h:  Support compilation as C++.
+
 Tue Jan  4 01:35:13 2000  J"orn Rennecke <amylaar@cygnus.co.uk>
 
        * fold-const.c (make_range): Don't try to reverse an unbounded range.
index 151c1de..1e49dc0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -31,6 +31,7 @@ Boston, MA 02111-1307, USA.  */
 #ifndef _STDBOOL_H
 #define _STDBOOL_H
 
+#ifndef __cplusplus
 /* The type `_Bool' must promote to `int' or `unsigned int'.  The constants
    `true' and `false' must have the value 0 and 1 respectively.  */
 typedef enum
@@ -46,6 +47,16 @@ typedef enum
 /* The macro `bool', which may be undefined, expands to _Bool.  */
 #define bool _Bool
 
+#else /* __cplusplus */
+
+/* Supporting <stdbool.h> in C++ is a GCC extension.  */
+#define _Bool  bool
+#define bool   bool
+#define false  false
+#define true   true
+
+#endif /* __cplusplus */
+
 /* Signal that all the definitions are present.  */
 #define __bool_true_false_are_defined  1