diff options
author | Chris Robinson <[email protected]> | 2012-10-09 01:46:02 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2012-10-09 01:46:02 -0700 |
commit | 8c3419ed48b0221816314f605b0a7c6e045d95dc (patch) | |
tree | 0f870aa1bd86669d330ad0f0bdbc2461299a2b78 | |
parent | a98361ebbe62bf3d222b01aa018fe7ada6ef4332 (diff) |
Define RESTRICT in config.h instead of alMain.h
-rw-r--r-- | CMakeLists.txt | 12 | ||||
-rw-r--r-- | OpenAL32/Include/alMain.h | 8 | ||||
-rw-r--r-- | config.h.in | 10 |
3 files changed, 14 insertions, 16 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f8ba10e2..2d22077d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,6 +86,7 @@ SET(LIB_VERSION "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}") SET(EXPORT_DECL "") SET(ALIGN_DECL "") +SET(RESTRICT_DECL "") CHECK_TYPE_SIZE("long" SIZEOF_LONG) @@ -94,8 +95,15 @@ CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG) CHECK_C_SOURCE_COMPILES("int *restrict foo; int main() {return 0;}" HAVE_RESTRICT) -CHECK_C_SOURCE_COMPILES("int *__restrict foo; - int main() {return 0;}" HAVE___RESTRICT) +IF(HAVE_RESTRICT) + SET(RESTRICT_DECL "restrict") +ELSE() + CHECK_C_SOURCE_COMPILES("int *__restrict foo; + int main() {return 0;}" HAVE___RESTRICT) + IF(HAVE___RESTRICT) + SET(RESTRICT_DECL "__restrict") + ENDIF() +ENDIF() # Add definitions, compiler switches, etc. diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 0b584fe2..e2031857 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -88,14 +88,6 @@ typedef ptrdiff_t ALsizeiptrEXT; #define PRINTF_STYLE(x, y) #endif -#if defined(HAVE_RESTRICT) -#define RESTRICT restrict -#elif defined(HAVE___RESTRICT) -#define RESTRICT __restrict -#else -#define RESTRICT -#endif - static const union { ALuint u; diff --git a/config.h.in b/config.h.in index 75d7a790..30b3e5e5 100644 --- a/config.h.in +++ b/config.h.in @@ -5,11 +5,15 @@ /* Define to the library version */ #define ALSOFT_VERSION "${LIB_VERSION}" +/* Define any available alignment declaration */ #define ALIGN(x) ${ALIGN_DECL} #ifdef __MINGW32__ #define align(x) aligned(x) #endif +/* Define to the appropriate 'restrict' keyword */ +#define RESTRICT ${RESTRICT_DECL} + /* Define if we have the C11 aligned_alloc function */ #cmakedefine HAVE_ALIGNED_ALLOC @@ -165,9 +169,3 @@ /* Define if we have pthread_setschedparam() */ #cmakedefine HAVE_PTHREAD_SETSCHEDPARAM - -/* Define if we have the restrict keyword */ -#cmakedefine HAVE_RESTRICT - -/* Define if we have the __restrict keyword */ -#cmakedefine HAVE___RESTRICT |