From d82a1d9751e6ba785a0be038fa314e16829ed0ee Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Wed, 26 Jul 2023 20:50:50 +0300
Subject: [PATCH] sync SDL2 headers and tests with current SDL2 branch.
---
include/SDL2/SDL_atomic.h | 2 +-
test/testatomic.c | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/SDL2/SDL_atomic.h b/include/SDL2/SDL_atomic.h
index 8273287..1dd816a 100644
--- a/include/SDL2/SDL_atomic.h
+++ b/include/SDL2/SDL_atomic.h
@@ -240,7 +240,7 @@ typedef void (*SDL_KernelMemoryBarrierFunc)();
/* "REP NOP" is PAUSE, coded for tools that don't know it by that name. */
#if (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))
#define SDL_CPUPauseInstruction() __asm__ __volatile__("pause\n") /* Some assemblers can't do REP NOP, so go with PAUSE. */
-#elif (defined(__arm__) && __ARM_ARCH >= 7) || defined(__aarch64__)
+#elif (defined(__arm__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7) || defined(__aarch64__)
#define SDL_CPUPauseInstruction() __asm__ __volatile__("yield" ::: "memory")
#elif (defined(__powerpc__) || defined(__powerpc64__))
#define SDL_CPUPauseInstruction() __asm__ __volatile__("or 27,27,27");
diff --git a/test/testatomic.c b/test/testatomic.c
index 15a7a6a..e7ea33f 100644
--- a/test/testatomic.c
+++ b/test/testatomic.c
@@ -234,7 +234,8 @@ static void RunEpicTest()
v = SDL_AtomicGet(&good);
SDL_Log("Atomic %d Non-Atomic %d\n", v, bad);
SDL_assert(v == Expect);
- SDL_assert(bad != Expect);
+ /* We can't guarantee that bad != Expect, this would happen on a single core system, for example. */
+ /*SDL_assert(bad != Expect);*/
}
/* End atomic operation test */