mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-28 12:27:24 +02:00
internal: Replace SDL_PUSH_ERROR with SDL_PushError.
Reference Issue #15458.
This commit is contained in:
@@ -52,16 +52,4 @@ typedef struct SDL_error
|
||||
// Defined in SDL_thread.c
|
||||
extern SDL_error *SDL_GetErrBuf(bool create);
|
||||
|
||||
// Macros to save and restore error values
|
||||
#define SDL_PushError() \
|
||||
char *saved_error = SDL_strdup(SDL_GetError())
|
||||
|
||||
#define SDL_PopError() \
|
||||
do { \
|
||||
if (saved_error) { \
|
||||
SDL_SetError("%s", saved_error); \
|
||||
SDL_free(saved_error); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif // SDL_error_c_h_
|
||||
|
||||
@@ -276,11 +276,16 @@ extern SDL_NORETURN void SDL_ExitProcess(int exitcode);
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#define PUSH_SDL_ERROR() \
|
||||
{ char *_error = SDL_strdup(SDL_GetError());
|
||||
// Macros to save and restore error values
|
||||
#define SDL_PushError() do { \
|
||||
char *saved_error = SDL_strdup(SDL_GetError())
|
||||
|
||||
#define POP_SDL_ERROR() \
|
||||
SDL_SetError("%s", _error); SDL_free(_error); }
|
||||
#define SDL_PopError() \
|
||||
if (saved_error) { \
|
||||
SDL_SetError("%s", saved_error); \
|
||||
SDL_free(saved_error); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#if defined(SDL_DISABLE_INVALID_PARAMS)
|
||||
#ifdef DEBUG
|
||||
|
||||
@@ -2584,9 +2584,9 @@ SDL_Window *SDL_CreateWindowWithProperties(SDL_PropertiesID props)
|
||||
SDL_UpdateWindowHierarchy(window, parent);
|
||||
|
||||
if (_this->CreateSDLWindow && !_this->CreateSDLWindow(_this, window, props)) {
|
||||
PUSH_SDL_ERROR()
|
||||
SDL_PushError();
|
||||
SDL_DestroyWindow(window);
|
||||
POP_SDL_ERROR()
|
||||
SDL_PopError();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user