Browse Source

dtoolbase: prefer GCC AtomicAdjust implementation over i386 asm one

rdb 7 years ago
parent
commit
21f5e77467
1 changed files with 14 additions and 14 deletions
  1. 14 14
      dtool/src/dtoolbase/atomicAdjust.h

+ 14 - 14
dtool/src/dtoolbase/atomicAdjust.h

@@ -30,6 +30,20 @@ struct AtomicAdjust {
 #include "atomicAdjustDummyImpl.h"
 #include "atomicAdjustDummyImpl.h"
 typedef AtomicAdjustDummyImpl AtomicAdjust;
 typedef AtomicAdjustDummyImpl AtomicAdjust;
 
 
+#elif (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))) || (defined(__clang__) && (__clang_major__ >= 3))
+// GCC 4.7 and above has built-in __atomic functions for atomic operations.
+// Clang 3.0 and above also supports them.
+
+#include "atomicAdjustGccImpl.h"
+typedef AtomicAdjustGccImpl AtomicAdjust;
+
+#if (__GCC_ATOMIC_INT_LOCK_FREE + __GCC_ATOMIC_LONG_LOCK_FREE) > 0
+#define HAVE_ATOMIC_COMPARE_AND_EXCHANGE 1
+#endif
+#if __GCC_ATOMIC_POINTER_LOCK_FREE > 0
+#define HAVE_ATOMIC_COMPARE_AND_EXCHANGE_PTR 1
+#endif
+
 #elif (defined(__i386__) || defined(_M_IX86)) && !defined(__APPLE__)
 #elif (defined(__i386__) || defined(_M_IX86)) && !defined(__APPLE__)
 // For an i386 architecture, we'll always use the i386 implementation.  It
 // For an i386 architecture, we'll always use the i386 implementation.  It
 // should be safe for any OS, and it might be a bit faster than any OS-
 // should be safe for any OS, and it might be a bit faster than any OS-
@@ -45,20 +59,6 @@ typedef AtomicAdjustI386Impl AtomicAdjust;
 #define HAVE_ATOMIC_COMPARE_AND_EXCHANGE 1
 #define HAVE_ATOMIC_COMPARE_AND_EXCHANGE 1
 #define HAVE_ATOMIC_COMPARE_AND_EXCHANGE_PTR 1
 #define HAVE_ATOMIC_COMPARE_AND_EXCHANGE_PTR 1
 
 
-#elif (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))) || (defined(__clang__) && (__clang_major__ >= 3))
-// GCC 4.7 and above has built-in __atomic functions for atomic operations.
-// Clang 3.0 and above also supports them.
-
-#include "atomicAdjustGccImpl.h"
-typedef AtomicAdjustGccImpl AtomicAdjust;
-
-#if (__GCC_ATOMIC_INT_LOCK_FREE + __GCC_ATOMIC_INT_LOCK_FREE) > 0
-#define HAVE_ATOMIC_COMPARE_AND_EXCHANGE 1
-#endif
-#if __GCC_ATOMIC_POINTER_LOCK_FREE > 0
-#define HAVE_ATOMIC_COMPARE_AND_EXCHANGE_PTR 1
-#endif
-
 #elif defined(THREAD_WIN32_IMPL)
 #elif defined(THREAD_WIN32_IMPL)
 
 
 #include "atomicAdjustWin32Impl.h"
 #include "atomicAdjustWin32Impl.h"