From 295ebf1cd559a0e29a2708d071128c70464ea1b1 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Thu, 26 Oct 2023 18:15:37 +0300
Subject: [PATCH] update after the SDL_LockMutex and SDL_UnlockMutex changes in
SDL3.
---
src/sdl2_compat.c | 16 ++++++++++++++++
src/sdl3_syms.h | 4 ++--
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index 4e555f9..bd71258 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -3439,6 +3439,22 @@ SDL_RenderGetIntegerScale(SDL_Renderer *renderer)
return SDL_FALSE;
}
+
+DECLSPEC int SDLCALL
+SDL_LockMutex(SDL_Mutex *a)
+{
+ SDL3_LockMutex(a);
+ return 0;
+}
+
+DECLSPEC int SDLCALL
+SDL_UnlockMutex(SDL_Mutex *a)
+{
+ SDL3_UnlockMutex(a);
+ return 0;
+}
+
+
DECLSPEC int SDLCALL
SDL_AudioInit(const char *driver_name)
{
diff --git a/src/sdl3_syms.h b/src/sdl3_syms.h
index 473f448..36215ed 100644
--- a/src/sdl3_syms.h
+++ b/src/sdl3_syms.h
@@ -238,9 +238,9 @@ SDL3_SYM_PASSTHROUGH(SDL_Cursor*,GetCursor,(void),(),return)
SDL3_SYM_PASSTHROUGH(SDL_Cursor*,GetDefaultCursor,(void),(),return)
SDL3_SYM_RENAMED(void,FreeCursor,DestroyCursor,(SDL_Cursor *a),(a),)
SDL3_SYM_PASSTHROUGH(SDL_Mutex*,CreateMutex,(void),(),return)
-SDL3_SYM_PASSTHROUGH(int,LockMutex,(SDL_Mutex *a),(a),return)
+SDL3_SYM(void,LockMutex,(SDL_Mutex *a),(a),)
SDL3_SYM_PASSTHROUGH(int,TryLockMutex,(SDL_Mutex *a),(a),return)
-SDL3_SYM_PASSTHROUGH(int,UnlockMutex,(SDL_Mutex *a),(a),return)
+SDL3_SYM(void,UnlockMutex,(SDL_Mutex *a),(a),)
SDL3_SYM_PASSTHROUGH(void,DestroyMutex,(SDL_Mutex *a),(a),)
SDL3_SYM_PASSTHROUGH(SDL_Semaphore*,CreateSemaphore,(Uint32 a),(a),return)
SDL3_SYM_PASSTHROUGH(void,DestroySemaphore,(SDL_Semaphore *a),(a),)