From 87aec3429b8dcc9e76603b7da3aff678c6e0b8a0 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Mon, 27 Mar 2023 18:43:22 +0200 Subject: [PATCH] Fix -Wundef warnings due to use of unguarded FAKE_RECURSIVE_MUTEX --- src/thread/pthread/SDL_sysmutex.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/thread/pthread/SDL_sysmutex.c b/src/thread/pthread/SDL_sysmutex.c index 201644572d..bbdf8804a9 100644 --- a/src/thread/pthread/SDL_sysmutex.c +++ b/src/thread/pthread/SDL_sysmutex.c @@ -31,7 +31,7 @@ struct SDL_mutex { pthread_mutex_t id; -#if FAKE_RECURSIVE_MUTEX +#ifdef FAKE_RECURSIVE_MUTEX int recursive; pthread_t owner; #endif @@ -76,7 +76,7 @@ void SDL_DestroyMutex(SDL_mutex *mutex) /* Lock the mutex */ int SDL_LockMutex(SDL_mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn't know about NULL mutexes */ { -#if FAKE_RECURSIVE_MUTEX +#ifdef FAKE_RECURSIVE_MUTEX pthread_t this_thread; #endif @@ -84,7 +84,7 @@ int SDL_LockMutex(SDL_mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn return 0; } -#if FAKE_RECURSIVE_MUTEX +#ifdef FAKE_RECURSIVE_MUTEX this_thread = pthread_self(); if (mutex->owner == this_thread) { ++mutex->recursive; @@ -112,7 +112,7 @@ int SDL_TryLockMutex(SDL_mutex *mutex) { int retval; int result; -#if FAKE_RECURSIVE_MUTEX +#ifdef FAKE_RECURSIVE_MUTEX pthread_t this_thread; #endif @@ -121,7 +121,7 @@ int SDL_TryLockMutex(SDL_mutex *mutex) } retval = 0; -#if FAKE_RECURSIVE_MUTEX +#ifdef FAKE_RECURSIVE_MUTEX this_thread = pthread_self(); if (mutex->owner == this_thread) { ++mutex->recursive; @@ -159,7 +159,7 @@ int SDL_UnlockMutex(SDL_mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doe return 0; } -#if FAKE_RECURSIVE_MUTEX +#ifdef FAKE_RECURSIVE_MUTEX /* We can only unlock the mutex if we own it */ if (pthread_self() == mutex->owner) { if (mutex->recursive) {