Skip to content

Commit ecd56bb

Browse files
committed
Removed SDL_GetErrorMsg(), trivially implemented in application code
1 parent 66e532f commit ecd56bb

File tree

6 files changed

+5
-26
lines changed

6 files changed

+5
-26
lines changed

docs/README-migration.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,11 @@ SDL_HasRDTSC() has been removed; there is no replacement. Don't use the RDTSC op
290290
291291
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.
292292
293+
## SDL_error.h
294+
295+
The following functions have been removed:
296+
* SDL_GetErrorMsg() - Can be implemented as `SDL_strlcpy(errstr, SDL_GetError(), maxlen);`
297+
293298
## SDL_events.h
294299
295300
The timestamp member of the SDL_Event structure now represents nanoseconds, and is populated with SDL_GetTicksNS()

include/SDL3/SDL_error.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -102,23 +102,6 @@ extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fm
102102
*/
103103
extern DECLSPEC const char *SDLCALL SDL_GetError(void);
104104

105-
/**
106-
* Get the last error message that was set for the current thread.
107-
*
108-
* This allows the caller to copy the error string into a provided buffer, but
109-
* otherwise operates exactly the same as SDL_GetError().
110-
*
111-
* \param errstr A buffer to fill with the last error message that was set for
112-
* the current thread
113-
* \param maxlen The size of the buffer pointed to by the errstr parameter
114-
* \returns the pointer passed in as the `errstr` parameter.
115-
*
116-
* \since This function is available since SDL 3.0.0.
117-
*
118-
* \sa SDL_GetError
119-
*/
120-
extern DECLSPEC char * SDLCALL SDL_GetErrorMsg(char *errstr, int maxlen);
121-
122105
/**
123106
* Clear any previous error message for this thread.
124107
*

src/SDL_error.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,3 @@ int SDL_Error(SDL_errorcode code)
9898
return SDL_SetError("Unknown SDL error");
9999
}
100100
}
101-
102-
char *SDL_GetErrorMsg(char *errstr, int maxlen)
103-
{
104-
SDL_strlcpy(errstr, SDL_GetError(), maxlen);
105-
return errstr;
106-
}

src/dynapi/SDL_dynapi.sym

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ SDL3_0.0.0 {
164164
SDL_GetDisplayUsableBounds;
165165
SDL_GetDisplays;
166166
SDL_GetError;
167-
SDL_GetErrorMsg;
168167
SDL_GetEventFilter;
169168
SDL_GetFullscreenDisplayModes;
170169
SDL_GetGamepadAppleSFSymbolsNameForAxis;

src/dynapi/SDL_dynapi_overrides.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@
188188
#define SDL_GetDisplayUsableBounds SDL_GetDisplayUsableBounds_REAL
189189
#define SDL_GetDisplays SDL_GetDisplays_REAL
190190
#define SDL_GetError SDL_GetError_REAL
191-
#define SDL_GetErrorMsg SDL_GetErrorMsg_REAL
192191
#define SDL_GetEventFilter SDL_GetEventFilter_REAL
193192
#define SDL_GetFullscreenDisplayModes SDL_GetFullscreenDisplayModes_REAL
194193
#define SDL_GetGamepadAppleSFSymbolsNameForAxis SDL_GetGamepadAppleSFSymbolsNameForAxis_REAL

src/dynapi/SDL_dynapi_procs.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ SDL_DYNAPI_PROC(const char*,SDL_GetDisplayName,(SDL_DisplayID a),(a),return)
247247
SDL_DYNAPI_PROC(int,SDL_GetDisplayUsableBounds,(SDL_DisplayID a, SDL_Rect *b),(a,b),return)
248248
SDL_DYNAPI_PROC(SDL_DisplayID*,SDL_GetDisplays,(int *a),(a),return)
249249
SDL_DYNAPI_PROC(const char*,SDL_GetError,(void),(),return)
250-
SDL_DYNAPI_PROC(char*,SDL_GetErrorMsg,(char *a, int b),(a,b),return)
251250
SDL_DYNAPI_PROC(SDL_bool,SDL_GetEventFilter,(SDL_EventFilter *a, void **b),(a,b),return)
252251
SDL_DYNAPI_PROC(const SDL_DisplayMode**,SDL_GetFullscreenDisplayModes,(SDL_DisplayID a, int *b),(a,b),return)
253252
SDL_DYNAPI_PROC(const char*,SDL_GetGamepadAppleSFSymbolsNameForAxis,(SDL_Gamepad *a, SDL_GamepadAxis b),(a,b),return)

0 commit comments

Comments
 (0)