change: Print out all SDL_Init errors to log

This commit is contained in:
tomikun committed 2026-07-31 15:09:50 +08:00
1 parent 56194e3d31
commit fdd6b29f31
1 file changed
+5
@@ -14,6 +14,7 @@ DECL_DLSYM(SDL_InitSubSystem)
DECL_DLSYM(SDL_SetHint);
DECL_DLSYM(SDL_SetTextInputArea);
DECL_DLSYM(SDL_SetError);
DECL_DLSYM(SDL_GetError);
static bool custom_SDL_InitSubSystem_Func(SDL_InitFlags flags) {
@@ -43,6 +44,10 @@ static bool custom_SDL_InitSubSystem_Func(SDL_InitFlags flags) {
// Call original func after doing all the needed setup
bool r = BYTEHOOK_CALL_PREV(custom_SDL_InitSubSystem_Func, SDL_InitSubSystem_t, flags);
if (!r){
SET_DLSYM_PTR(dlopen("libSDL3.so", RTLD_NOLOAD), SDL_GetError);
LOGI("Amethyst-Android: SDL_InitSubsystem Error: %s", SDL_GetError_p())
}
BYTEHOOK_POP_STACK();
return r;
}