Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
HAVE_GCC_ATOMICS covers the test and set
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jan 22, 2011
1 parent ff2325b commit b8cc850
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
24 changes: 12 additions & 12 deletions configure.in
Expand Up @@ -311,18 +311,18 @@ if test x$enable_gcc_atomics = xyes; then

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

Expand Down
1 change: 0 additions & 1 deletion include/SDL_config_iphoneos.h
Expand Up @@ -44,7 +44,6 @@ typedef unsigned long uintptr_t;
#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
Expand Down
2 changes: 1 addition & 1 deletion src/atomic/SDL_spinlock.c
Expand Up @@ -36,7 +36,7 @@ SDL_AtomicTryLock(SDL_SpinLock *lock)
#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__)
Expand Down

0 comments on commit b8cc850

Please sign in to comment.