From 342614a6ec40df9d7b757d17d59afdb7bd258f4b Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Wed, 6 Mar 2013 19:56:38 -0500 Subject: [PATCH] Fix the horribly wrong check for atomic support with MSVC --- BPTCEncoder/CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/BPTCEncoder/CMakeLists.txt b/BPTCEncoder/CMakeLists.txt index bae84c0..0fd10c8 100644 --- a/BPTCEncoder/CMakeLists.txt +++ b/BPTCEncoder/CMakeLists.txt @@ -161,10 +161,12 @@ ELSEIF( MSVC ) CHECK_CXX_SOURCE_RUNS(" #include int main() { - int *x = _aligned_malloc(sizeof(int), 32); - x = InterlockedIncrement(&x); - free(x); - return !x; + unsigned int val; + unsigned int *x = (unsigned int *)_aligned_malloc(sizeof(int), 32); + *x = 0; + val = InterlockedIncrement(x); + _aligned_free(x); + return !val; }" HAS_MSVC_ATOMICS )