__atomic_load_n() appears to be available in GCC 5 but not GCC 4
authorSam Lantinga <slouken@libsdl.org>
Thu, 30 Mar 2017 06:52:34 -0700
changeset 10950fd1b8fd3b937
parent 10949 96539b1f6069
child 10951 8625e527f0f0
__atomic_load_n() appears to be available in GCC 5 but not GCC 4
src/atomic/SDL_atomic.c
     1.1 --- a/src/atomic/SDL_atomic.c	Thu Mar 30 16:33:47 2017 -0400
     1.2 +++ b/src/atomic/SDL_atomic.c	Thu Mar 30 06:52:34 2017 -0700
     1.3 @@ -211,8 +211,7 @@
     1.4  int
     1.5  SDL_AtomicGet(SDL_atomic_t *a)
     1.6  {
     1.7 -/* !!! FIXME: __atomic_load_n is only in newer GCCs and Clang, I think, and apparently not on Android. This #ifdef should be more exact. */
     1.8 -#if defined(HAVE_GCC_ATOMICS) && !defined(__ANDROID__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
     1.9 +#if defined(HAVE_GCC_ATOMICS) && (__GNUC__ >= 5)
    1.10      return __atomic_load_n(&a->value, __ATOMIC_SEQ_CST);
    1.11  #else
    1.12      int value;
    1.13 @@ -226,8 +225,7 @@
    1.14  void *
    1.15  SDL_AtomicGetPtr(void **a)
    1.16  {
    1.17 -/* !!! FIXME: __atomic_load_n is only in newer GCCs and Clang, I think, and apparently not on Android. This #ifdef should be more exact. */
    1.18 -#if defined(HAVE_GCC_ATOMICS) && !defined(__ANDROID__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
    1.19 +#if defined(HAVE_GCC_ATOMICS) && (__GNUC__ >= 5)
    1.20      return __atomic_load_n(a, __ATOMIC_SEQ_CST);
    1.21  #else
    1.22      void *value;