aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Headers/stdbool.h
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-09-29 04:57:11 +0000
committerDouglas Gregor <dgregor@apple.com>2010-09-29 04:57:11 +0000
commit1f7d02fb6df4852573bc292b88a3b344ecab08c9 (patch)
treea011263bc10dc7ee38ed8cb8c276ecd64287b557 /clang/lib/Headers/stdbool.h
parent52e60208830e04c4f7b5e258fd9afc45fa505890 (diff)
downloadllvm-1f7d02fb6df4852573bc292b88a3b344ecab08c9.zip
llvm-1f7d02fb6df4852573bc292b88a3b344ecab08c9.tar.gz
llvm-1f7d02fb6df4852573bc292b88a3b344ecab08c9.tar.bz2
Define _Bool, bool, true, and false macros in <stdbool.h> when we're
in a GNU-compatible C++ dialect. Fixes <rdar://problem/8477819>. llvm-svn: 115028
Diffstat (limited to 'clang/lib/Headers/stdbool.h')
-rw-r--r--clang/lib/Headers/stdbool.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Headers/stdbool.h b/clang/lib/Headers/stdbool.h
index e44a1f9..0467893 100644
--- a/clang/lib/Headers/stdbool.h
+++ b/clang/lib/Headers/stdbool.h
@@ -26,11 +26,17 @@
#ifndef __STDBOOL_H
#define __STDBOOL_H
-/* Don't define bool, true, and false in C++ */
+/* Don't define bool, true, and false in C++, except as a GNU extension. */
#ifndef __cplusplus
#define bool _Bool
#define true 1
#define false 0
+#elif defined(__GNUC__) && !defined(__STRICT_ANSI__)
+/* Define _Bool, bool, false, true as a GNU extension. */
+#define _Bool bool
+#define bool bool
+#define false false
+#define true true
#endif
#define __bool_true_false_are_defined 1