diff --git a/cmThread.c b/cmThread.c index 18c5f0b..fc4bf3f 100644 --- a/cmThread.c +++ b/cmThread.c @@ -1290,6 +1290,8 @@ bool cmThFloatCAS( float* addr, float old, float new ) #endif } +#define OS_VER_10_6 + bool cmThPtrCAS( void* addr, void* old, void* neww ) { #ifdef OS_OSX @@ -1302,7 +1304,7 @@ bool cmThPtrCAS( void* addr, void* old, void* neww ) union { void* addr; -#ifdef OS_64 +#ifdef OS_VER_10_6 int64_t val; #else int val; @@ -1314,7 +1316,7 @@ bool cmThPtrCAS( void* addr, void* old, void* neww ) ov.u.addr = old; nv.u.addr = neww; -#ifdef OS_64 +#ifdef OS_VER_10_6 int rv = OSAtomicCompareAndSwap64Barrier(ov.u.val,nv.u.val,(int64_t*)addr); #else int rv = OSAtomicCompareAndSwap32Barrier(ov.u.val,nv.u.val,(int*)addr); @@ -1323,7 +1325,7 @@ bool cmThPtrCAS( void* addr, void* old, void* neww ) #endif #ifdef OS_LINUX -#ifdef OS_64 +#ifdef OS_VER_10_6 return __sync_bool_compare_and_swap((long long*)addr, (long long)old, (long long)neww); #else return __sync_bool_compare_and_swap((int*)addr,(int)old,(int)neww);