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).
This commit is contained in:
parent
9959972c7e
commit
cc599333a8
@ -125,20 +125,9 @@ IF(MSVC)
|
|||||||
CHECK_C_SOURCE_COMPILES("int *restrict foo;
|
CHECK_C_SOURCE_COMPILES("int *restrict foo;
|
||||||
int main() {return 0;}" HAVE_RESTRICT)
|
int main() {return 0;}" HAVE_RESTRICT)
|
||||||
IF(NOT 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 <stdlib.h>
|
|
||||||
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=")
|
ADD_DEFINITIONS("-Drestrict=")
|
||||||
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Drestrict=")
|
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Drestrict=")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
CHECK_C_SOURCE_COMPILES("inline void foo(void) { }
|
CHECK_C_SOURCE_COMPILES("inline void foo(void) { }
|
||||||
int main() {return 0;}" HAVE_INLINE)
|
int main() {return 0;}" HAVE_INLINE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user