Should now compile on 32 bit linux and 64 bit linux
authorBob Pendleton <bob@pendleton.com>
Mon, 21 Sep 2009 22:23:41 +0000
changeset 3296 6fe620d7ce92
parent 3295 4ff84e8939c1
child 3297 d430982cd5cc
Should now compile on 32 bit linux and 64 bit linux
src/atomic/linux/SDL_atomic.c
--- a/src/atomic/linux/SDL_atomic.c	Mon Sep 21 11:31:28 2009 +0000
+++ b/src/atomic/linux/SDL_atomic.c	Mon Sep 21 22:23:41 2009 +0000
@@ -82,16 +82,31 @@
 #define nativeAddThenFetch32
 #define nativeSubtractThenFetch32
 
-#define nativeTestThenSet64
-#define nativeClear64
-#define nativeFetchThenIncrement64
-#define nativeFetchThenDecrement64
-#define nativeFetchThenAdd64
-#define nativeFetchThenSubtract64
-#define nativeIncrementThenFetch64
-#define nativeDecrementThenFetch64
-#define nativeAddThenFetch64
-#define nativeSubtractThenFetch64
+#ifdef SDL_HAS_64BIT_TYPE
+  #ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
+    #define nativeTestThenSet64
+    #define nativeClear64
+    #define nativeFetchThenIncrement64
+    #define nativeFetchThenDecrement64
+    #define nativeFetchThenAdd64
+    #define nativeFetchThenSubtract64
+    #define nativeIncrementThenFetch64
+    #define nativeDecrementThenFetch64
+    #define nativeAddThenFetch64
+    #define nativeSubtractThenFetch64
+  #elif
+    #undef  nativeTestThenSet64
+    #undef  nativeClear64
+    #undef  nativeFetchThenIncrement64
+    #undef  nativeFetchThenDecrement64
+    #undef  nativeFetchThenAdd64
+    #undef  nativeFetchThenSubtract64
+    #undef  nativeIncrementThenFetch64
+    #undef  nativeDecrementThenFetch64
+    #undef  nativeAddThenFetch64
+    #undef  nativeSubtractThenFetch64
+  #endif /* __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 */
+#endif /* SDL_HAS_64BIT_TYPE */
 
 /* 
   If any of the operations are not provided then we must emulate some