sdl2-compat: update after SDL3 RWops freesrc type change from int to SDL_bool

From 38d21b7b40a36365581daa0a596e02f527110ab4 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Mon, 10 Jul 2023 01:51:50 +0300
Subject: [PATCH] update after SDL3 RWops freesrc type change from int to
 SDL_bool

---
 src/sdl2_compat.c | 6 +++---
 src/sdl3_syms.h   | 7 ++++---
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index 9d50ca5..b32a44b 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -2078,7 +2078,7 @@ SDL_LoadFile_RW(SDL2_RWops *rwops2, size_t *datasize, int freesrc)
     void *retval = NULL;
     SDL_RWops *rwops3 = RWops2to3(rwops2);
     if (rwops3) {
-        retval = SDL3_LoadFile_RW(rwops3, datasize, freesrc);
+        retval = SDL3_LoadFile_RW(rwops3, datasize, freesrc ? SDL_TRUE : SDL_FALSE);
         if (!freesrc) {
             SDL3_DestroyRW(rwops3);  /* don't close it because that'll close the SDL2_RWops. */
         }
@@ -2096,7 +2096,7 @@ SDL_LoadWAV_RW(SDL2_RWops *rwops2, int freesrc, SDL_AudioSpec *spec, Uint8 **aud
     SDL_AudioSpec *retval = NULL;
     SDL_RWops *rwops3 = RWops2to3(rwops2);
     if (rwops3) {
-        retval = SDL3_LoadWAV_RW(rwops3, freesrc, spec, audio_buf, audio_len);
+        retval = SDL3_LoadWAV_RW(rwops3, freesrc ? SDL_TRUE : SDL_FALSE, spec, audio_buf, audio_len);
         if (!freesrc) {
             SDL3_DestroyRW(rwops3);  /* don't close it because that'll close the SDL2_RWops. */
         }
@@ -2114,7 +2114,7 @@ SDL_LoadBMP_RW(SDL2_RWops *rwops2, int freesrc)
     SDL_Surface *retval = NULL;
     SDL_RWops *rwops3 = RWops2to3(rwops2);
     if (rwops3) {
-        retval = SDL3_LoadBMP_RW(rwops3, freesrc);
+        retval = SDL3_LoadBMP_RW(rwops3, freesrc ? SDL_TRUE : SDL_FALSE);
         if (!freesrc) {
             SDL3_DestroyRW(rwops3);  /* don't close it because that'll close the SDL2_RWops. */
         }
diff --git a/src/sdl3_syms.h b/src/sdl3_syms.h
index 2070edb..0268020 100644
--- a/src/sdl3_syms.h
+++ b/src/sdl3_syms.h
@@ -106,7 +106,7 @@ SDL3_SYM(SDL_AudioDeviceID,OpenAudioDevice,(const char *a, int b, const SDL_Audi
 SDL3_SYM(SDL_AudioStatus,GetAudioDeviceStatus,(SDL_AudioDeviceID a),(a),return)
 SDL3_SYM(int,PlayAudioDevice,(SDL_AudioDeviceID a),(a),return)
 SDL3_SYM(int,PauseAudioDevice,(SDL_AudioDeviceID a),(a),return)
-SDL3_SYM(SDL_AudioSpec*,LoadWAV_RW,(SDL_RWops *a, int b, SDL_AudioSpec *c, Uint8 **d, Uint32 *e),(a,b,c,d,e),return)
+SDL3_SYM(SDL_AudioSpec*,LoadWAV_RW,(SDL_RWops *a, SDL_bool b, SDL_AudioSpec *c, Uint8 **d, Uint32 *e),(a,b,c,d,e),return)
 SDL3_SYM(int,MixAudioFormat,(Uint8 *a, const Uint8 *b, SDL_AudioFormat c, Uint32 d, int e),(a,b,c,d,e),return)
 SDL3_SYM(int,LockAudioDevice,(SDL_AudioDeviceID a),(a),return)
 SDL3_SYM(void,UnlockAudioDevice,(SDL_AudioDeviceID a),(a),)
@@ -428,7 +428,7 @@ SDL3_SYM_RENAMED(void,FreeSurface,DestroySurface,(SDL_Surface *a),(a),)
 SDL3_SYM_PASSTHROUGH(int,SetSurfacePalette,(SDL_Surface *a, SDL_Palette *b),(a,b),return)
 SDL3_SYM_PASSTHROUGH(int,LockSurface,(SDL_Surface *a),(a),return)
 SDL3_SYM_PASSTHROUGH(void,UnlockSurface,(SDL_Surface *a),(a),)
-SDL3_SYM(SDL_Surface*,LoadBMP_RW,(SDL_RWops *a, int b),(a,b),return)
+SDL3_SYM(SDL_Surface*,LoadBMP_RW,(SDL_RWops *a, SDL_bool b),(a,b),return)
 SDL3_SYM(int,SaveBMP_RW,(SDL_Surface *a, SDL_RWops *b, int c),(a,b,c),return)
 SDL3_SYM_PASSTHROUGH(int,SetSurfaceRLE,(SDL_Surface *a, int b),(a,b),return)
 SDL3_SYM_RENAMED(int,SetColorKey,SetSurfaceColorKey,(SDL_Surface *a, int b, Uint32 c),(a,b,c),return)
@@ -588,7 +588,7 @@ SDL3_SYM_RENAMED(SDL_JoystickType,JoystickGetType,GetJoystickType,(SDL_Joystick
 SDL3_SYM_PASSTHROUGH(void,MemoryBarrierReleaseFunction,(void),(),)
 SDL3_SYM_PASSTHROUGH(void,MemoryBarrierAcquireFunction,(void),(),)
 SDL3_SYM_PASSTHROUGH(size_t,utf8strlen,(const char *a),(a),return)
-SDL3_SYM(void*,LoadFile_RW,(SDL_RWops *a, size_t *b, int c),(a,b,c),return)
+SDL3_SYM(void*,LoadFile_RW,(SDL_RWops *a, size_t *b, SDL_bool c),(a,b,c),return)
 SDL3_SYM_PASSTHROUGH(int,wcscmp,(const wchar_t *a, const wchar_t *b),(a,b),return)
 SDL3_SYM_PASSTHROUGH(SDL_BlendMode,ComposeCustomBlendMode,(SDL_BlendFactor a, SDL_BlendFactor b, SDL_BlendOperation c, SDL_BlendFactor d, SDL_BlendFactor e, SDL_BlendOperation f),(a,b,c,d,e,f),return)
 SDL3_SYM_PASSTHROUGH(SDL_Surface*,DuplicateSurface,(SDL_Surface *a),(a),return)
@@ -918,3 +918,4 @@ SDL3_SYM_PASSTHROUGH(int,DestroyWindowSurface,(SDL_Window *a),(a),return)
 #undef SDL3_SYM_PASSTHROUGH
 #undef SDL3_SYM_RENAMED
 #undef SDL3_SYM_VARARGS
+