diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-09-29 04:57:11 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-09-29 04:57:11 +0000 |
commit | 1f7d02fb6df4852573bc292b88a3b344ecab08c9 (patch) | |
tree | a011263bc10dc7ee38ed8cb8c276ecd64287b557 /clang/lib/Headers/stdbool.h | |
parent | 52e60208830e04c4f7b5e258fd9afc45fa505890 (diff) | |
download | llvm-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.h | 8 |
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 |