From 959cfc428ea17679bb2132d946022a7e45695d71 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 30 Jun 2019 23:58:31 -0700 Subject: [PATCH] Fixed memory barrier macro check so it isn't quite so fragile --- include/SDL_atomic.h | 1 + src/atomic/SDL_atomic.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/SDL_atomic.h b/include/SDL_atomic.h index bea071c67..deee35f91 100644 --- a/include/SDL_atomic.h +++ b/include/SDL_atomic.h @@ -184,6 +184,7 @@ typedef void (*SDL_KernelMemoryBarrierFunc)(); #elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_5TE__) #ifdef __thumb__ /* The mcr instruction isn't available in thumb mode, use real functions */ +#define SDL_MEMORY_BARRIER_USES_FUNCTION #define SDL_MemoryBarrierRelease() SDL_MemoryBarrierReleaseFunction() #define SDL_MemoryBarrierAcquire() SDL_MemoryBarrierAcquireFunction() #else diff --git a/src/atomic/SDL_atomic.c b/src/atomic/SDL_atomic.c index d3327d454..8483bdfa3 100644 --- a/src/atomic/SDL_atomic.c +++ b/src/atomic/SDL_atomic.c @@ -289,7 +289,7 @@ SDL_AtomicGetPtr(void **a) #endif } -#if defined(__thumb__) && (defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_5TE__)) +#ifdef SDL_MEMORY_BARRIER_USES_FUNCTION #error This file should be built in arm mode so the mcr instruction is available for memory barriers #endif