From bac5300261659fd1c2c2dc3f306e063e5790179b Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Sun, 11 Dec 2022 23:54:20 -0500
Subject: [PATCH] error: Don't implement SDL_GetError.
It was only overridden to report that SDL3 failed to load at all, but we
actually just terminate the process if that had happened.
---
src/sdl2_compat.c | 12 ------------
src/sdl3_syms.h | 2 +-
2 files changed, 1 insertion(+), 13 deletions(-)
diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index 013c94e..3c90705 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -981,18 +981,6 @@ SDL_SetError(const char *fmt, ...)
}
}
-DECLSPEC const char * SDLCALL
-SDL_GetError(void)
-{
- /* !!! FIXME: can this actually happen? or did we always terminate the process in this case? */
- if (SDL3_GetError == NULL) {
- static const char noload_errstr[] = "SDL3 library isn't loaded.";
- return noload_errstr;
- }
- return SDL3_GetError();
-}
-
-
DECLSPEC int SDLCALL
SDL_sscanf(const char *text, const char *fmt, ...)
{
diff --git a/src/sdl3_syms.h b/src/sdl3_syms.h
index 52440cc..577be81 100644
--- a/src/sdl3_syms.h
+++ b/src/sdl3_syms.h
@@ -133,7 +133,7 @@ SDL3_SYM_PASSTHROUGH(SDL_bool,HasSSE3,(void),(),return)
SDL3_SYM_PASSTHROUGH(SDL_bool,HasSSE41,(void),(),return)
SDL3_SYM_PASSTHROUGH(SDL_bool,HasSSE42,(void),(),return)
SDL3_SYM_PASSTHROUGH(int,GetSystemRAM,(void),(),return)
-SDL3_SYM(const char*,GetError,(void),(),return)
+SDL3_SYM_PASSTHROUGH(const char*,GetError,(void),(),return)
SDL3_SYM_PASSTHROUGH(void,ClearError,(void),(),)
SDL3_SYM_PASSTHROUGH(int,Error,(SDL_errorcode a),(a),return)
SDL3_SYM_PASSTHROUGH(void,PumpEvents,(void),(),)