Browse Source

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

more work to fix correctly.
master
kevin 11 years ago
parent
commit
11b11347a0
1 changed files with 5 additions and 3 deletions
  1. 5
    3
      cmThread.c

+ 5
- 3
cmThread.c View File

1290
 #endif
1290
 #endif
1291
 }
1291
 }
1292
 
1292
 
1293
+#define OS_VER_10_6
1294
+
1293
 bool     cmThPtrCAS(   void*    addr, void*    old, void*    neww )
1295
 bool     cmThPtrCAS(   void*    addr, void*    old, void*    neww )
1294
 {
1296
 {
1295
 #ifdef OS_OSX
1297
 #ifdef OS_OSX
1302
     union 
1304
     union 
1303
     {
1305
     {
1304
       void* addr;
1306
       void* addr;
1305
-#ifdef OS_64
1307
+#ifdef OS_VER_10_6
1306
       int64_t   val;
1308
       int64_t   val;
1307
 #else
1309
 #else
1308
       int val;
1310
       int val;
1314
   
1316
   
1315
   ov.u.addr = old;
1317
   ov.u.addr = old;
1316
   nv.u.addr = neww;
1318
   nv.u.addr = neww;
1317
-#ifdef OS_64
1319
+#ifdef OS_VER_10_6
1318
   int rv = OSAtomicCompareAndSwap64Barrier(ov.u.val,nv.u.val,(int64_t*)addr);
1320
   int rv = OSAtomicCompareAndSwap64Barrier(ov.u.val,nv.u.val,(int64_t*)addr);
1319
 #else
1321
 #else
1320
   int rv = OSAtomicCompareAndSwap32Barrier(ov.u.val,nv.u.val,(int*)addr);
1322
   int rv = OSAtomicCompareAndSwap32Barrier(ov.u.val,nv.u.val,(int*)addr);
1323
 #endif
1325
 #endif
1324
 
1326
 
1325
 #ifdef OS_LINUX
1327
 #ifdef OS_LINUX
1326
-#ifdef OS_64
1328
+#ifdef OS_VER_10_6
1327
   return  __sync_bool_compare_and_swap((long long*)addr, (long long)old, (long long)neww); 
1329
   return  __sync_bool_compare_and_swap((long long*)addr, (long long)old, (long long)neww); 
1328
 #else
1330
 #else
1329
   return  __sync_bool_compare_and_swap((int*)addr,(int)old,(int)neww); 
1331
   return  __sync_bool_compare_and_swap((int*)addr,(int)old,(int)neww); 

Loading…
Cancel
Save