SDL: atomic: detect clang separately

From ebdfd0e1750cd76ef418b88f06c163bd02d12edd Mon Sep 17 00:00:00 2001
From: Alex R <[EMAIL REDACTED]>
Date: Fri, 17 Sep 2021 00:45:07 +0200
Subject: [PATCH] atomic: detect clang separately

---
 src/atomic/SDL_atomic.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/src/atomic/SDL_atomic.c b/src/atomic/SDL_atomic.c
index 10e8d6987a..58f891be51 100644
--- a/src/atomic/SDL_atomic.c
+++ b/src/atomic/SDL_atomic.c
@@ -36,20 +36,18 @@
 #endif
 
 /* The __atomic_load_n() intrinsic showed up in different times for different compilers. */
-#if defined(HAVE_GCC_ATOMICS)
-# if defined(__clang__)
-#   if __has_builtin(__atomic_load_n)
-      /* !!! FIXME: this advertises as available in the NDK but uses an external symbol we don't have.
-         It might be in a later NDK or we might need an extra library? --ryan. */
-#     if !defined(__ANDROID__)
-#       define HAVE_ATOMIC_LOAD_N 1
-#     endif
-#   endif
-# elif defined(__GNUC__)
+#if defined(__clang__)
+#  if __has_builtin(__atomic_load_n) || defined(HAVE_GCC_ATOMICS)
+     /* !!! FIXME: this advertises as available in the NDK but uses an external symbol we don't have.
+        It might be in a later NDK or we might need an extra library? --ryan. */
+#    if !defined(__ANDROID__)
+#      define HAVE_ATOMIC_LOAD_N 1
+#    endif
+#  endif
+#elif defined(__GNUC__)
 #   if (__GNUC__ >= 5)
 #     define HAVE_ATOMIC_LOAD_N 1
 #   endif
-# endif
 #endif
 
 #if defined(__WATCOMC__) && defined(__386__)