aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-05-06 23:10:50 -0700
committerChris Robinson <[email protected]>2014-05-06 23:10:50 -0700
commit38b98de78eceb77e0b2acc84877bf425ba0fb07d (patch)
tree0624c376a9705d16a0774254217fbae21c9df8cb /CMakeLists.txt
parent1aff37114a930a6a7fab7067572133345398b542 (diff)
Check for C99 _Bool support
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2500960c..e6e0761e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -136,6 +136,16 @@ CHECK_C_SOURCE_COMPILES(
}"
HAVE_C99_VLA)
+# Check if we have C99 bool
+CHECK_C_SOURCE_COMPILES(
+"int main(int argc, char *argv[])
+ {
+ volatile _Bool ret;
+ ret = (argc > 1) ? 1 : 0;
+ return ret ? -1 : 0;
+ }"
+HAVE_C99_BOOL)
+
# Check if we have C11 static_assert
CHECK_C_SOURCE_COMPILES(
"int main()
@@ -297,6 +307,7 @@ ENDIF()
CHECK_C_SOURCE_COMPILES("int foo(const char *str, ...) __attribute__((format(printf, 1, 2)));
int main() {return 0;}" HAVE_GCC_FORMAT)
+CHECK_INCLUDE_FILE(stdbool.h HAVE_STDBOOL_H)
CHECK_INCLUDE_FILE(stdalign.h HAVE_STDALIGN_H)
IF(NOT HAVE_C99_VLA)
CHECK_INCLUDE_FILE(alloca.h HAVE_ALLOCA_H)