From be1d44279c715c5ac879f5698bc604fe9070ff0c Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 27 Oct 2025 09:36:46 -0700 Subject: [PATCH] Fixed error: incompatible function pointer types passing SDL/src/sensor/emscripten/SDL_emscriptensensor.c:80:5: error: incompatible function pointer types passing 'int (*)(int, const EmscriptenDeviceMotionEvent *, void *)' (aka 'int (*)(int, const struct EmscriptenDeviceMotionEvent *, void *)') to parameter of type 'em_devicemotion_callback_func' (aka 'bool (*)(int, const struct EmscriptenDeviceMotionEvent *, void *)') [-Wincompatible-function-pointer-types] 80 | emscripten_set_devicemotion_callback((void *)0, false, &SDL_EMSCRIPTEN_SensorCallback); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- src/sensor/emscripten/SDL_emscriptensensor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sensor/emscripten/SDL_emscriptensensor.c b/src/sensor/emscripten/SDL_emscriptensensor.c index b718fda717..a899a4bce8 100644 --- a/src/sensor/emscripten/SDL_emscriptensensor.c +++ b/src/sensor/emscripten/SDL_emscriptensensor.c @@ -67,7 +67,7 @@ static void SDL_EMSCRIPTEN_GyroscopeCallback(const EmscriptenDeviceMotionEvent * SDL_sensors[1].new_data = true; } -static int SDL_EMSCRIPTEN_SensorCallback(int event_type, const EmscriptenDeviceMotionEvent *event, void *user_data) +static EM_BOOL SDL_EMSCRIPTEN_SensorCallback(int event_type, const EmscriptenDeviceMotionEvent *event, void *user_data) { SDL_EMSCRIPTEN_AccelerometerCallback(event); SDL_EMSCRIPTEN_GyroscopeCallback(event);