C++ Disable bool keywords in C files

The keywords bool, true, and false don't exist in C90.

When using C99 and stdbool.h, they are defined as macros.

Amends commit 7b2c09a118

Change-Id: I2f2391dd11be841d7d7b249db0b4add8523e53a5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Andre Hartmann
2017-04-14 08:27:42 +02:00
committed by André Hartmann
parent 5d97c4871a
commit 0d1fef41f7

View File

@@ -99,7 +99,7 @@ static inline int classify4(const char *s, LanguageFeatures features)
} }
} }
} }
else if (s[0] == 'b') { else if (features.cxxEnabled && s[0] == 'b') {
if (s[1] == 'o') { if (s[1] == 'o') {
if (s[2] == 'o') { if (s[2] == 'o') {
if (s[3] == 'l') { if (s[3] == 'l') {
@@ -173,7 +173,7 @@ static inline int classify4(const char *s, LanguageFeatures features)
} }
} }
} }
else if (s[1] == 'r') { else if (features.cxxEnabled && s[1] == 'r') {
if (s[2] == 'u') { if (s[2] == 'u') {
if (s[3] == 'e') { if (s[3] == 'e') {
return T_TRUE; return T_TRUE;
@@ -255,7 +255,7 @@ static inline int classify5(const char *s, LanguageFeatures features)
} }
} }
} }
else if (s[0] == 'f') { else if (features.cxxEnabled && s[0] == 'f') {
if (s[1] == 'a') { if (s[1] == 'a') {
if (s[2] == 'l') { if (s[2] == 'l') {
if (s[3] == 's') { if (s[3] == 's') {