sdl2-compat: update after enum SDL_IOWhence change in SDL3

From 64eedcdd2c127172e39f2b6ff5cdd6bb4878ae0d Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Sun, 9 Jun 2024 14:01:50 +0300
Subject: [PATCH] update after enum SDL_IOWhence change in SDL3

also sync an SDL2 header with latest SDL2
---
 include/SDL2/SDL_joystick.h | 6 +++++-
 src/sdl2_compat.c           | 4 ++--
 src/sdl3_syms.h             | 2 +-
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/include/SDL2/SDL_joystick.h b/include/SDL2/SDL_joystick.h
index 44529ed..863a3c1 100644
--- a/include/SDL2/SDL_joystick.h
+++ b/include/SDL2/SDL_joystick.h
@@ -77,7 +77,11 @@ extern SDL_mutex *SDL_joystick_lock;
 struct _SDL_Joystick;
 typedef struct _SDL_Joystick SDL_Joystick;
 
-/* A structure that encodes the stable unique id for a joystick device */
+/**
+ * A structure that encodes the stable unique id for a joystick device.
+ *
+ * This is just a standard SDL_GUID by a different name.
+ */
 typedef SDL_GUID SDL_JoystickGUID;
 
 /**
diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index d5fbb05..3df652c 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -2197,7 +2197,7 @@ RWops3to2_size(SDL2_RWops *rwops2)
 static Sint64 SDLCALL
 RWops3to2_seek(SDL2_RWops *rwops2, Sint64 offset, int whence)
 {
-    return SDL3_SeekIO(rwops2->hidden.sdl3.iostrm, offset, whence);
+    return SDL3_SeekIO(rwops2->hidden.sdl3.iostrm, offset, (SDL_IOWhence) whence);
 }
 
 static size_t SDLCALL
@@ -2507,7 +2507,7 @@ RWops2to3_size(void *userdata)
 }
 
 static Sint64 SDLCALL
-RWops2to3_seek(void *userdata, Sint64 offset, int whence)
+RWops2to3_seek(void *userdata, Sint64 offset, SDL_IOWhence whence)
 {
     return SDL_RWseek((SDL2_RWops *) userdata, offset, whence);
 }
diff --git a/src/sdl3_syms.h b/src/sdl3_syms.h
index 7f8b462..863ac53 100644
--- a/src/sdl3_syms.h
+++ b/src/sdl3_syms.h
@@ -607,7 +607,7 @@ SDL3_SYM_RENAMED(size_t,SIMDGetAlignment,GetSIMDAlignment,(void),(),return)
 SDL3_SYM(void*,aligned_alloc,(size_t a, size_t b),(a,b),return)
 SDL3_SYM(void,aligned_free,(void *a),(a),)
 SDL3_SYM(Sint64,GetIOSize,(SDL_IOStream *a),(a),return)
-SDL3_SYM(Sint64,SeekIO,(SDL_IOStream *a, Sint64 b, int c),(a,b,c),return)
+SDL3_SYM(Sint64,SeekIO,(SDL_IOStream *a, Sint64 b, SDL_IOWhence c),(a,b,c),return)
 SDL3_SYM(Sint64,TellIO,(SDL_IOStream *a),(a),return)
 SDL3_SYM(size_t,ReadIO,(SDL_IOStream *a, void *b, size_t c),(a,b,c),return)
 SDL3_SYM(size_t,WriteIO,(SDL_IOStream *a, const void *b, size_t c),(a,b,c),return)