diff options
author | Chris Robinson <[email protected]> | 2013-05-24 00:45:25 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-05-24 00:45:25 -0700 |
commit | 18807e06fe5e7f632250575e71c053fca3cac763 (patch) | |
tree | 0e4080729251f86bd1745ee326f83da351b298d6 /CMakeLists.txt | |
parent | 357cf72ab33ef1807da8ea6ce4633fd8e2a89553 (diff) |
Check for __restrict in a way to make MSVC happy, hopefully
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) |