summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 10 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f8ba10e2..2d22077d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -86,6 +86,7 @@ SET(LIB_VERSION "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}")
SET(EXPORT_DECL "")
SET(ALIGN_DECL "")
+SET(RESTRICT_DECL "")
CHECK_TYPE_SIZE("long" SIZEOF_LONG)
@@ -94,8 +95,15 @@ CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG)
CHECK_C_SOURCE_COMPILES("int *restrict foo;
int main() {return 0;}" HAVE_RESTRICT)
-CHECK_C_SOURCE_COMPILES("int *__restrict foo;
- int main() {return 0;}" HAVE___RESTRICT)
+IF(HAVE_RESTRICT)
+ SET(RESTRICT_DECL "restrict")
+ELSE()
+ CHECK_C_SOURCE_COMPILES("int *__restrict foo;
+ int main() {return 0;}" HAVE___RESTRICT)
+ IF(HAVE___RESTRICT)
+ SET(RESTRICT_DECL "__restrict")
+ ENDIF()
+ENDIF()
# Add definitions, compiler switches, etc.