Commit 67f12ede3ba88814dd1258d73d9879e945aa4a9b

Ozkan Sezer 2022-02-08T21:32:50

move bug #5333 fix to headers

diff --git a/include/SDL_config_windows.h b/include/SDL_config_windows.h
index c9ed1cf..efb246d 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 690ffe1..c548fd6 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 4f10741..bdd347e 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