sdl2-compat: prototype correctness after SDL_JoystickID and SDL_SensorID changes

From 17e8d13acbd9464ade430c703634092c260b8f6d Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Fri, 3 Mar 2023 01:55:02 +0300
Subject: [PATCH] prototype correctness after SDL_JoystickID and SDL_SensorID
 changes

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

diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index 9bcc24a..df2b908 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -4861,6 +4861,18 @@ SDL_JoystickInstanceID(SDL_Joystick *joystick)
     return (SDL2_JoystickID)jid;
 }
 
+DECLSPEC SDL_Joystick* SDLCALL
+SDL_JoystickFromInstanceID(SDL2_JoystickID jid)
+{
+    return SDL3_GetJoystickFromInstanceID((SDL_JoystickID)jid);
+}
+
+DECLSPEC SDL_GameController* SDLCALL
+SDL_GameControllerFromInstanceID(SDL2_JoystickID jid)
+{
+    return SDL3_GetGamepadFromInstanceID((SDL_JoystickID)jid);
+}
+
 DECLSPEC int SDLCALL
 SDL_JoystickGetDevicePlayerIndex(int idx)
 {
@@ -5014,6 +5026,12 @@ SDL_SensorGetInstanceID(SDL_Sensor *sensor)
     return (SDL2_SensorID)sid;
 }
 
+DECLSPEC SDL_Sensor* SDLCALL
+SDL_SensorFromInstanceID(SDL2_SensorID sid)
+{
+    return SDL3_GetSensorFromInstanceID((SDL_SensorID)sid);
+}
+
 DECLSPEC SDL_Sensor* SDLCALL
 SDL_SensorOpen(int idx)
 {
diff --git a/src/sdl3_syms.h b/src/sdl3_syms.h
index 6bdc036..06f69ba 100644
--- a/src/sdl3_syms.h
+++ b/src/sdl3_syms.h
@@ -562,8 +562,8 @@ SDL3_SYM_PASSTHROUGH(SDL_Window*,GetGrabbedWindow,(void),(),return)
 SDL3_SYM_PASSTHROUGH(void,SetWindowsMessageHook,(SDL_WindowsMessageHook a, void *b),(a,b),)
 #endif
 SDL3_SYM_RENAMED(SDL_JoystickPowerLevel,JoystickCurrentPowerLevel,GetJoystickPowerLevel,(SDL_Joystick *a),(a),return)
-SDL3_SYM_RENAMED(SDL_GameController*,GameControllerFromInstanceID,GetGamepadFromInstanceID,(SDL_JoystickID a),(a),return)
-SDL3_SYM_RENAMED(SDL_Joystick*,JoystickFromInstanceID,GetJoystickFromInstanceID,(SDL_JoystickID a),(a),return)
+SDL3_SYM(SDL_GameController*,GetGamepadFromInstanceID,(SDL_JoystickID a),(a),return)
+SDL3_SYM(SDL_Joystick*,GetJoystickFromInstanceID,(SDL_JoystickID a),(a),return)
 SDL3_SYM(int,GetDisplayUsableBounds,(SDL_DisplayID a, SDL_Rect *b),(a,b),return)
 SDL3_SYM_PASSTHROUGH(int,GetWindowBordersSize,(SDL_Window *a, int *b, int *c, int *d, int *e),(a,b,c,d,e),return)
 SDL3_SYM_PASSTHROUGH(int,SetWindowOpacity,(SDL_Window *a, float b),(a,b),return)
@@ -646,7 +646,7 @@ SDL3_SYM_PASSTHROUGH(float,expf,(float a),(a),return)
 SDL3_SYM_PASSTHROUGH(wchar_t*,wcsdup,(const wchar_t *a),(a),return)
 SDL3_SYM_RENAMED(int,GameControllerRumble,RumbleGamepad,(SDL_GameController *a, Uint16 b, Uint16 c, Uint32 d),(a,b,c,d),return)
 SDL3_SYM_RENAMED(int,JoystickRumble,RumbleJoystick,(SDL_Joystick *a, Uint16 b, Uint16 c, Uint32 d),(a,b,c,d),return)
-SDL3_SYM_RENAMED(SDL_Sensor*,SensorFromInstanceID,GetSensorFromInstanceID,(SDL_SensorID a),(a),return)
+SDL3_SYM(SDL_Sensor*,GetSensorFromInstanceID,(SDL_SensorID a),(a),return)
 SDL3_SYM_RENAMED(const char*,SensorGetName,GetSensorName,(SDL_Sensor *a),(a),return)
 SDL3_SYM_RENAMED(SDL_SensorType,SensorGetType,GetSensorType,(SDL_Sensor *a),(a),return)
 SDL3_SYM_RENAMED(int,SensorGetNonPortableType,GetSensorNonPortableType,(SDL_Sensor *a),(a),return)