From 544fe4acc490306098dd6788cbf37bd9feef20ed Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 31 Oct 2013 20:09:16 -0700 Subject: [PATCH] cmThread.c : Changed OS_VER_10_6 TO OSX_VER_10_5 to better reflect the reason for the conditional compilation. --- cmThread.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/cmThread.c b/cmThread.c index 936e204..cb3108d 100644 --- a/cmThread.c +++ b/cmThread.c @@ -1072,7 +1072,6 @@ bool cmThFloatCAS( float* addr, float old, float new ) #endif } -#define OS_VER_10_6 bool cmThPtrCAS( void* addr, void* old, void* neww ) { @@ -1086,10 +1085,10 @@ bool cmThPtrCAS( void* addr, void* old, void* neww ) union { void* addr; -#ifdef OS_VER_10_6 - int64_t val; -#else +#ifdef OSX_VER_10_5 int val; +#else + int64_t val; #endif } u; } s_t; @@ -1098,19 +1097,19 @@ bool cmThPtrCAS( void* addr, void* old, void* neww ) ov.u.addr = old; nv.u.addr = neww; -#ifdef OS_VER_10_6 - int rv = OSAtomicCompareAndSwap64Barrier(ov.u.val,nv.u.val,(int64_t*)addr); -#else +#ifdef OSX_VER_10_5 int rv = OSAtomicCompareAndSwap32Barrier(ov.u.val,nv.u.val,(int*)addr); +#else + int rv = OSAtomicCompareAndSwap64Barrier(ov.u.val,nv.u.val,(int64_t*)addr); #endif return rv; #endif #ifdef OS_LINUX -#ifdef OS_VER_10_6 - return __sync_bool_compare_and_swap((long long*)addr, (long long)old, (long long)neww); -#else +#ifdef OSX_VER_10_5 return __sync_bool_compare_and_swap((int*)addr,(int)old,(int)neww); +#else + return __sync_bool_compare_and_swap((long long*)addr, (long long)old, (long long)neww); #endif #endif }