From 7891e72dca9718c01d484bd9564f95ccb19f67b8 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 30 Mar 2017 06:52:34 -0700 Subject: [PATCH] __atomic_load_n() appears to be available in GCC 5 but not GCC 4 --- src/atomic/SDL_atomic.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/atomic/SDL_atomic.c b/src/atomic/SDL_atomic.c index 8ee867b14..c9cb4a919 100644 --- a/src/atomic/SDL_atomic.c +++ b/src/atomic/SDL_atomic.c @@ -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; @@ -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;