summaryrefslogtreecommitdiff
path: root/gcc/ginclude/stdbool.h
diff options
context:
space:
mode:
authorloewis <loewis@138bc75d-0d04-0410-961f-82ee72b054a4>2000-01-04 10:12:22 +0000
committerloewis <loewis@138bc75d-0d04-0410-961f-82ee72b054a4>2000-01-04 10:12:22 +0000
commitebcb1851c4cabf8bace02d1ee97f13291461be1a (patch)
treef152d2dcbba7c9d6a05f09e7ac6258bad9376c5e /gcc/ginclude/stdbool.h
parent01496bfd073f3efb830f8567a8072ecb8e3e9a57 (diff)
downloadgcc-ebcb1851c4cabf8bace02d1ee97f13291461be1a.tar.gz
* ginclude/stdbool.h: Support compilation as C++.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31201 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ginclude/stdbool.h')
-rw-r--r--gcc/ginclude/stdbool.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/ginclude/stdbool.h b/gcc/ginclude/stdbool.h
index 151c1de71a7..1e49dc0fe74 100644
--- a/gcc/ginclude/stdbool.h
+++ b/gcc/ginclude/stdbool.h
@@ -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