cmThread.c : Changed OS_64 cond. compilation to OS_VER_10_6. This needs

more work to fix correctly.
This commit is contained in:
kevin 2013-10-17 16:53:19 -07:00
parent 2855506568
commit 11b11347a0

View File

@ -1290,6 +1290,8 @@ 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 )
{ {
#ifdef OS_OSX #ifdef OS_OSX
@ -1302,7 +1304,7 @@ bool cmThPtrCAS( void* addr, void* old, void* neww )
union union
{ {
void* addr; void* addr;
#ifdef OS_64 #ifdef OS_VER_10_6
int64_t val; int64_t val;
#else #else
int val; int val;
@ -1314,7 +1316,7 @@ 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_64 #ifdef OS_VER_10_6
int rv = OSAtomicCompareAndSwap64Barrier(ov.u.val,nv.u.val,(int64_t*)addr); int rv = OSAtomicCompareAndSwap64Barrier(ov.u.val,nv.u.val,(int64_t*)addr);
#else #else
int rv = OSAtomicCompareAndSwap32Barrier(ov.u.val,nv.u.val,(int*)addr); int rv = OSAtomicCompareAndSwap32Barrier(ov.u.val,nv.u.val,(int*)addr);
@ -1323,7 +1325,7 @@ bool cmThPtrCAS( void* addr, void* old, void* neww )
#endif #endif
#ifdef OS_LINUX #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); return __sync_bool_compare_and_swap((long long*)addr, (long long)old, (long long)neww);
#else #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);