# HG changeset patch # User Sam Lantinga # Date 1295675155 28800 # Node ID 55ff76cdbbb8a4271ea05f2af6a35b7a82e6af6b # Parent 042ad5e274ed43ed673756707e38f81433a3d5c0 HAVE_GCC_ATOMICS covers the test and set diff -r 042ad5e274ed -r 55ff76cdbbb8 configure.in --- a/configure.in Fri Jan 21 21:43:56 2011 -0800 +++ b/configure.in Fri Jan 21 21:45:55 2011 -0800 @@ -311,18 +311,18 @@ if test x$have_gcc_atomics = xyes; then AC_DEFINE(HAVE_GCC_ATOMICS) - fi - - # See if we have the minimum operation needed for GCC atomics - AC_TRY_LINK([ - ],[ - int a; - __sync_lock_test_and_set(&a, 1); - ],[ - have_gcc_sync_lock_test_and_set=yes - ]) - if test x$have_gcc_sync_lock_test_and_set = xyes; then - AC_DEFINE(HAVE_GCC_SYNC_LOCK_TEST_AND_SET) + else + # See if we have the minimum operation needed for GCC atomics + AC_TRY_LINK([ + ],[ + int a; + __sync_lock_test_and_set(&a, 1); + ],[ + have_gcc_sync_lock_test_and_set=yes + ]) + if test x$have_gcc_sync_lock_test_and_set = xyes; then + AC_DEFINE(HAVE_GCC_SYNC_LOCK_TEST_AND_SET) + fi fi fi diff -r 042ad5e274ed -r 55ff76cdbbb8 include/SDL_config_iphoneos.h --- a/include/SDL_config_iphoneos.h Fri Jan 21 21:43:56 2011 -0800 +++ b/include/SDL_config_iphoneos.h Fri Jan 21 21:45:55 2011 -0800 @@ -44,7 +44,6 @@ #define SDL_HAS_64BIT_TYPE 1 #define HAVE_GCC_ATOMICS 1 -#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1 #define HAVE_ALLOCA_H 1 #define HAVE_SYS_TYPES_H 1 diff -r 042ad5e274ed -r 55ff76cdbbb8 src/atomic/SDL_spinlock.c --- a/src/atomic/SDL_spinlock.c Fri Jan 21 21:43:56 2011 -0800 +++ b/src/atomic/SDL_spinlock.c Fri Jan 21 21:45:55 2011 -0800 @@ -36,7 +36,7 @@ #elif defined(__MACOSX__) return OSAtomicCompareAndSwap32Barrier(0, 1, lock); -#elif defined(HAVE_GCC_SYNC_LOCK_TEST_AND_SET) +#elif defined(HAVE_GCC_ATOMICS) || defined(HAVE_GCC_SYNC_LOCK_TEST_AND_SET) return (__sync_lock_test_and_set(lock, 1) == 0); #elif defined(__GNUC__) && defined(__arm__) && defined(__ARM_ARCH_5__)