diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d4fa325f..20f752c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -104,7 +104,11 @@ CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG) CHECK_C_SOURCE_COMPILES("int *restrict foo; int main() {return 0;}" HAVE_RESTRICT) IF(NOT HAVE_RESTRICT) - CHECK_C_SOURCE_COMPILES("int *__restrict foo; + # Slightly convoluted way to do this, because MSVC may barf is restrict is + # defined to __restrict. + CHECK_C_SOURCE_COMPILES("#define restrict __restrict + #include <stdlib.h> + int *restrict foo; int main() {return 0;}" HAVE___RESTRICT) IF(HAVE___RESTRICT) ADD_DEFINITIONS(-Drestrict=__restrict) |