SDL: move bug #5333 fix to headers

From 67f12ede3ba88814dd1258d73d9879e945aa4a9b Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Tue, 8 Feb 2022 21:32:50 +0300
Subject: [PATCH] move bug #5333 fix to headers

---
 include/SDL_config_windows.h | 4 ++++
 include/SDL_config_winrt.h   | 4 ++++
 src/atomic/SDL_spinlock.c    | 6 ------
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/include/SDL_config_windows.h b/include/SDL_config_windows.h
index c9ed1cfeaad..efb246da968 100644
--- a/include/SDL_config_windows.h
+++ b/include/SDL_config_windows.h
@@ -90,6 +90,10 @@ typedef unsigned int uintptr_t;
 # define SIZEOF_VOIDP 4
 #endif
 
+#ifdef __clang__
+# define HAVE_GCC_ATOMICS 1
+#endif
+
 #define HAVE_DDRAW_H 1
 #define HAVE_DINPUT_H 1
 #define HAVE_DSOUND_H 1
diff --git a/include/SDL_config_winrt.h b/include/SDL_config_winrt.h
index 690ffe15914..c548fd695a6 100644
--- a/include/SDL_config_winrt.h
+++ b/include/SDL_config_winrt.h
@@ -92,6 +92,10 @@ typedef unsigned int uintptr_t;
 # define SIZEOF_VOIDP 4
 #endif
 
+#ifdef __clang__
+# define HAVE_GCC_ATOMICS 1
+#endif
+
 /* Useful headers */
 #define HAVE_DXGI_H 1
 #if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP
diff --git a/src/atomic/SDL_spinlock.c b/src/atomic/SDL_spinlock.c
index 4f10741c7c2..bdd347e413e 100644
--- a/src/atomic/SDL_spinlock.c
+++ b/src/atomic/SDL_spinlock.c
@@ -28,12 +28,6 @@
 #include "SDL_mutex.h"
 #include "SDL_timer.h"
 
-#if defined(__WIN32__) && defined(__clang__)
-# ifndef HAVE_GCC_ATOMICS
-# define HAVE_GCC_ATOMICS 1
-# endif
-#endif
-
 #if !defined(HAVE_GCC_ATOMICS) && defined(__SOLARIS__)
 #include <atomic.h>
 #endif