aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/cplusplus/Keywords.cpp
diff options
context:
space:
mode:
authorAndre Hartmann <aha_1980@gmx.de>2017-04-14 08:27:42 +0200
committerAndré Hartmann <aha_1980@gmx.de>2017-04-14 07:59:48 +0000
commit0d1fef41f76c04ede629406b6d15847c453f6d96 (patch)
treea3fa45fdd98f8d7e48232879abbeda01e5488c44 /src/libs/3rdparty/cplusplus/Keywords.cpp
parent5d97c4871ae33c72217b23dba5467b9aed144a84 (diff)
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 7b2c09a1186f2cf69f276017ba08da89560f55be Change-Id: I2f2391dd11be841d7d7b249db0b4add8523e53a5 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/libs/3rdparty/cplusplus/Keywords.cpp')
-rw-r--r--src/libs/3rdparty/cplusplus/Keywords.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libs/3rdparty/cplusplus/Keywords.cpp b/src/libs/3rdparty/cplusplus/Keywords.cpp
index a71058a903..522c131e47 100644
--- a/src/libs/3rdparty/cplusplus/Keywords.cpp
+++ b/src/libs/3rdparty/cplusplus/Keywords.cpp
@@ -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[2] == 'o') {
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[3] == 'e') {
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[2] == 'l') {
if (s[3] == 's') {