Fix the horribly wrong check for atomic support with MSVC

This commit is contained in:
Pavel Krajcevski 2013-03-06 19:56:38 -05:00
parent 2127c04987
commit 342614a6ec

View file

@ -161,10 +161,12 @@ ELSEIF( MSVC )
CHECK_CXX_SOURCE_RUNS(" CHECK_CXX_SOURCE_RUNS("
#include <Windows.h> #include <Windows.h>
int main() { int main() {
int *x = _aligned_malloc(sizeof(int), 32); unsigned int val;
x = InterlockedIncrement(&x); unsigned int *x = (unsigned int *)_aligned_malloc(sizeof(int), 32);
free(x); *x = 0;
return !x; val = InterlockedIncrement(x);
_aligned_free(x);
return !val;
}" }"
HAS_MSVC_ATOMICS HAS_MSVC_ATOMICS
) )