Skip to content

Commit

Permalink
__atomic_load_n() appears to be available in GCC 5 but not GCC 4
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Mar 30, 2017
1 parent 028716e commit 7891e72
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/atomic/SDL_atomic.c
Expand Up @@ -211,8 +211,7 @@ SDL_AtomicAdd(SDL_atomic_t *a, int v)
int
SDL_AtomicGet(SDL_atomic_t *a)
{
/* !!! FIXME: __atomic_load_n is only in newer GCCs and Clang, I think, and apparently not on Android. This #ifdef should be more exact. */
#if defined(HAVE_GCC_ATOMICS) && !defined(__ANDROID__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
#if defined(HAVE_GCC_ATOMICS) && (__GNUC__ >= 5)
return __atomic_load_n(&a->value, __ATOMIC_SEQ_CST);
#else
int value;
Expand All @@ -226,8 +225,7 @@ SDL_AtomicGet(SDL_atomic_t *a)
void *
SDL_AtomicGetPtr(void **a)
{
/* !!! FIXME: __atomic_load_n is only in newer GCCs and Clang, I think, and apparently not on Android. This #ifdef should be more exact. */
#if defined(HAVE_GCC_ATOMICS) && !defined(__ANDROID__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
#if defined(HAVE_GCC_ATOMICS) && (__GNUC__ >= 5)
return __atomic_load_n(a, __ATOMIC_SEQ_CST);
#else
void *value;
Expand Down

0 comments on commit 7891e72

Please sign in to comment.