From 93b357a0d25f133096fba3ee75b82925905a3416 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Mon, 27 Mar 2023 15:05:05 +0200 Subject: [PATCH] Fix -Wundef warnings due to use of unguarded SDL_ATOMIC_DISABLED --- src/atomic/SDL_spinlock.c | 2 +- src/dynapi/SDL_dynapi.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/atomic/SDL_spinlock.c b/src/atomic/SDL_spinlock.c index 178302cd73..91cc7366a4 100644 --- a/src/atomic/SDL_spinlock.c +++ b/src/atomic/SDL_spinlock.c @@ -60,7 +60,7 @@ extern __inline int _SDL_xchg_watcom(volatile int *a, int v); SDL_bool SDL_AtomicTryLock(SDL_SpinLock *lock) { -#if SDL_ATOMIC_DISABLED +#if defined(SDL_ATOMIC_DISABLED) /* Terrible terrible damage */ static SDL_mutex *_spinlock_mutex; diff --git a/src/dynapi/SDL_dynapi.c b/src/dynapi/SDL_dynapi.c index 79e74ff352..45d068af64 100644 --- a/src/dynapi/SDL_dynapi.c +++ b/src/dynapi/SDL_dynapi.c @@ -484,7 +484,7 @@ static void SDL_InitDynamicAPI(void) /* SDL_AtomicLock calls SDL mutex functions to emulate if SDL_ATOMIC_DISABLED, which we can't do here, so in such a configuration, you're on your own. */ -#if !SDL_ATOMIC_DISABLED +#ifndef SDL_ATOMIC_DISABLED static SDL_SpinLock lock = 0; SDL_AtomicLock_REAL(&lock); #endif @@ -494,7 +494,7 @@ static void SDL_InitDynamicAPI(void) already_initialized = SDL_TRUE; } -#if !SDL_ATOMIC_DISABLED +#ifndef SDL_ATOMIC_DISABLED SDL_AtomicUnlock_REAL(&lock); #endif }