浏览代码

Removed SDL_GetErrorMsg(), trivially implemented in application code

Sam Lantinga 1 年之前
父节点
当前提交
ecd56bb8f0

+ 5 - 0
docs/README-migration.md

@@ -290,6 +290,11 @@ SDL_HasRDTSC() has been removed; there is no replacement. Don't use the RDTSC op
 
 SDL_SIMDAlloc(), SDL_SIMDRealloc(), and SDL_SIMDFree() have been removed. You can use SDL_aligned_alloc() and SDL_aligned_free() with SDL_SIMDGetAlignment() to get the same functionality.
 
+## SDL_error.h
+
+The following functions have been removed:
+* SDL_GetErrorMsg() - Can be implemented as `SDL_strlcpy(errstr, SDL_GetError(), maxlen);`
+
 ## SDL_events.h
 
 The timestamp member of the SDL_Event structure now represents nanoseconds, and is populated with SDL_GetTicksNS()

+ 0 - 17
include/SDL3/SDL_error.h

@@ -102,23 +102,6 @@ extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fm
  */
 extern DECLSPEC const char *SDLCALL SDL_GetError(void);
 
-/**
- * Get the last error message that was set for the current thread.
- *
- * This allows the caller to copy the error string into a provided buffer, but
- * otherwise operates exactly the same as SDL_GetError().
- *
- * \param errstr A buffer to fill with the last error message that was set for
- *               the current thread
- * \param maxlen The size of the buffer pointed to by the errstr parameter
- * \returns the pointer passed in as the `errstr` parameter.
- *
- * \since This function is available since SDL 3.0.0.
- *
- * \sa SDL_GetError
- */
-extern DECLSPEC char * SDLCALL SDL_GetErrorMsg(char *errstr, int maxlen);
-
 /**
  * Clear any previous error message for this thread.
  *

+ 0 - 6
src/SDL_error.c

@@ -98,9 +98,3 @@ int SDL_Error(SDL_errorcode code)
         return SDL_SetError("Unknown SDL error");
     }
 }
-
-char *SDL_GetErrorMsg(char *errstr, int maxlen)
-{
-    SDL_strlcpy(errstr, SDL_GetError(), maxlen);
-    return errstr;
-}

+ 0 - 1
src/dynapi/SDL_dynapi.sym

@@ -164,7 +164,6 @@ SDL3_0.0.0 {
     SDL_GetDisplayUsableBounds;
     SDL_GetDisplays;
     SDL_GetError;
-    SDL_GetErrorMsg;
     SDL_GetEventFilter;
     SDL_GetFullscreenDisplayModes;
     SDL_GetGamepadAppleSFSymbolsNameForAxis;

+ 0 - 1
src/dynapi/SDL_dynapi_overrides.h

@@ -188,7 +188,6 @@
 #define SDL_GetDisplayUsableBounds SDL_GetDisplayUsableBounds_REAL
 #define SDL_GetDisplays SDL_GetDisplays_REAL
 #define SDL_GetError SDL_GetError_REAL
-#define SDL_GetErrorMsg SDL_GetErrorMsg_REAL
 #define SDL_GetEventFilter SDL_GetEventFilter_REAL
 #define SDL_GetFullscreenDisplayModes SDL_GetFullscreenDisplayModes_REAL
 #define SDL_GetGamepadAppleSFSymbolsNameForAxis SDL_GetGamepadAppleSFSymbolsNameForAxis_REAL

+ 0 - 1
src/dynapi/SDL_dynapi_procs.h

@@ -247,7 +247,6 @@ SDL_DYNAPI_PROC(const char*,SDL_GetDisplayName,(SDL_DisplayID a),(a),return)
 SDL_DYNAPI_PROC(int,SDL_GetDisplayUsableBounds,(SDL_DisplayID a, SDL_Rect *b),(a,b),return)
 SDL_DYNAPI_PROC(SDL_DisplayID*,SDL_GetDisplays,(int *a),(a),return)
 SDL_DYNAPI_PROC(const char*,SDL_GetError,(void),(),return)
-SDL_DYNAPI_PROC(char*,SDL_GetErrorMsg,(char *a, int b),(a,b),return)
 SDL_DYNAPI_PROC(SDL_bool,SDL_GetEventFilter,(SDL_EventFilter *a, void **b),(a,b),return)
 SDL_DYNAPI_PROC(const SDL_DisplayMode**,SDL_GetFullscreenDisplayModes,(SDL_DisplayID a, int *b),(a,b),return)
 SDL_DYNAPI_PROC(const char*,SDL_GetGamepadAppleSFSymbolsNameForAxis,(SDL_Gamepad *a, SDL_GamepadAxis b),(a,b),return)