From f352c649e5bcf4ccfbe11d5468924abf11de64dd Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Sun, 11 Dec 2022 23:33:00 -0500
Subject: [PATCH] sensor: Stubbed out the sensor timestamp functions.
If these become necessary, we can try to track these from SDL3 events to
report meaningful data here.
---
src/sdl2_compat.c | 15 +++++++++++++++
src/sdl3_syms.h | 3 ---
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index ba50b07..e4f6b23 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -942,6 +942,21 @@ SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy)
return SDL3_SetError("Joystick only has 0 balls");
}
+
+/* this API was removed in SDL3; use sensor event timestamps instead! */
+DECLSPEC int SDLCALL
+SDL_GameControllerGetSensorDataWithTimestamp(SDL_GameController *gamecontroller, SDL_SensorType type, Uint64 *timestamp, float *data, int num_values)
+{
+ return SDL3_Unsupported(); /* !!! FIXME: maybe try to track this from SDL3 events if something needs this? I can't imagine this was widely used. */
+}
+
+/* this API was removed in SDL3; use sensor event timestamps instead! */
+DECLSPEC int SDLCALL
+SDL_SensorGetDataWithTimestamp(SDL_Sensor *sensor, Uint64 *timestamp, float *data, int num_values)
+{
+ return SDL3_Unsupported(); /* !!! FIXME: maybe try to track this from SDL3 events if something needs this? I can't imagine this was widely used. */
+}
+
#ifdef __cplusplus
}
#endif
diff --git a/src/sdl3_syms.h b/src/sdl3_syms.h
index 00ee76d..1ff2949 100644
--- a/src/sdl3_syms.h
+++ b/src/sdl3_syms.h
@@ -944,9 +944,6 @@ SDL3_SYM_PASSTHROUGH(char*,GetPrimarySelectionText,(void),(),return)
SDL3_SYM_PASSTHROUGH(SDL_bool,HasPrimarySelectionText,(void),(),return)
SDL3_SYM_PASSTHROUGH(void,ResetHints,(void),(),)
SDL3_SYM_PASSTHROUGH(char*,strcasestr,(const char *a, const char *b),(a,b),return)
-/* FIXME: IMPLEMENT AND THESE TWO: */
-SDL3_SYM_PASSTHROUGH(int,GameControllerGetSensorDataWithTimestamp,(SDL_GameController *a, SDL_SensorType b, Uint64 *c, float *d, int e),(a,b,c,d,e),return)
-SDL3_SYM_PASSTHROUGH(int,SensorGetDataWithTimestamp,(SDL_Sensor *a, Uint64 *b, float *c, int d),(a,b,c,d),return)
#undef SDL3_SYM
#undef SDL3_SYM_PASSTHROUGH