From cc599333a8100dd3b8e52ef018e01d4e184c1532 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 23 Mar 2014 01:35:15 -0700 Subject: [PATCH] Don't try to use __restrict as a replacement for restrict The compiler it's intended for, MSVC, can't use it anyway because of problems it causes with __declspec(restrict). --- CMakeLists.txt | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b22ff6c6..d80fbfcc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,19 +125,8 @@ IF(MSVC) CHECK_C_SOURCE_COMPILES("int *restrict foo; int main() {return 0;}" HAVE_RESTRICT) IF(NOT HAVE_RESTRICT) - # Slightly convoluted way to do this, because MSVC may barf if restrict is - # defined to __restrict. - CHECK_C_SOURCE_COMPILES("#define restrict __restrict - #include - int *restrict foo; - int main() {return 0;}" HAVE___RESTRICT) - IF(HAVE___RESTRICT) - ADD_DEFINITIONS(-Drestrict=__restrict) - SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Drestrict=__restrict") - ELSE() - ADD_DEFINITIONS("-Drestrict=") - SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Drestrict=") - ENDIF() + ADD_DEFINITIONS("-Drestrict=") + SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Drestrict=") ENDIF() CHECK_C_SOURCE_COMPILES("inline void foo(void) { } -- 2.11.4.GIT