Check for __restrict in a way to make MSVC happy, hopefully

This commit is contained in:
Chris Robinson
2013-05-24 00:45:25 -07:00
parent 357cf72ab3
commit 18807e06fe
+5 -1
View File
@@ -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)