cmThread.c : Changed OS_VER_10_6 TO OSX_VER_10_5 to better reflect the

reason for the conditional compilation.
This commit is contained in:
kevin 2013-10-31 20:09:16 -07:00
parent edad3b99cd
commit 544fe4acc4

View File

@ -1072,7 +1072,6 @@ bool cmThFloatCAS( float* addr, float old, float new )
#endif #endif
} }
#define OS_VER_10_6
bool cmThPtrCAS( void* addr, void* old, void* neww ) bool cmThPtrCAS( void* addr, void* old, void* neww )
{ {
@ -1086,10 +1085,10 @@ bool cmThPtrCAS( void* addr, void* old, void* neww )
union union
{ {
void* addr; void* addr;
#ifdef OS_VER_10_6 #ifdef OSX_VER_10_5
int64_t val;
#else
int val; int val;
#else
int64_t val;
#endif #endif
} u; } u;
} s_t; } s_t;
@ -1098,19 +1097,19 @@ bool cmThPtrCAS( void* addr, void* old, void* neww )
ov.u.addr = old; ov.u.addr = old;
nv.u.addr = neww; nv.u.addr = neww;
#ifdef OS_VER_10_6 #ifdef OSX_VER_10_5
int rv = OSAtomicCompareAndSwap64Barrier(ov.u.val,nv.u.val,(int64_t*)addr);
#else
int rv = OSAtomicCompareAndSwap32Barrier(ov.u.val,nv.u.val,(int*)addr); 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 #endif
return rv; return rv;
#endif #endif
#ifdef OS_LINUX #ifdef OS_LINUX
#ifdef OS_VER_10_6 #ifdef OSX_VER_10_5
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); 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
#endif #endif
} }