From a9672bb43e899d99184d6e291c03480da65f93b8 Mon Sep 17 00:00:00 2001
From: Simon McVittie <[EMAIL REDACTED]>
Date: Tue, 4 Feb 2025 20:00:55 +0000
Subject: [PATCH] SDL_config_unix.h: Only define HAVE_GCC_ATOMICS for gcc or
clang
The gcc atomic operations are a gcc-specific extension, which clang
implements for compatibility. In the unlikely event that someone compiles
sdl2-compat with some other compiler, we can't assume their presence.
Signed-off-by: Simon McVittie <smcv@collabora.com>
---
include/SDL2/SDL_config_unix.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/SDL2/SDL_config_unix.h b/include/SDL2/SDL_config_unix.h
index 7ac920d..82fae0d 100644
--- a/include/SDL2/SDL_config_unix.h
+++ b/include/SDL2/SDL_config_unix.h
@@ -31,7 +31,9 @@
#define SIZEOF_VOIDP 4
#endif
+#if defined(__GNUC__) || defined(__clang__)
#define HAVE_GCC_ATOMICS 1
+#endif
/* Assume that any reasonable Unix platform has Standard C headers */
#define STDC_HEADERS 1