File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,16 +52,4 @@ typedef struct SDL_error
5252// Defined in SDL_thread.c
5353extern SDL_error * SDL_GetErrBuf (bool create );
5454
55- // Macros to save and restore error values
56- #define SDL_PushError () \
57- char *saved_error = SDL_strdup(SDL_GetError())
58-
59- #define SDL_PopError () \
60- do { \
61- if (saved_error) { \
62- SDL_SetError("%s", saved_error); \
63- SDL_free(saved_error); \
64- } \
65- } while (0)
66-
6755#endif // SDL_error_c_h_
Original file line number Diff line number Diff line change @@ -276,11 +276,16 @@ extern SDL_NORETURN void SDL_ExitProcess(int exitcode);
276276 } while (0)
277277#endif
278278
279- #define PUSH_SDL_ERROR () \
280- { char *_error = SDL_strdup(SDL_GetError());
281-
282- #define POP_SDL_ERROR () \
283- SDL_SetError("%s", _error); SDL_free(_error); }
279+ // Macros to save and restore error values
280+ #define SDL_PushError () do { \
281+ char *saved_error = SDL_strdup(SDL_GetError())
282+
283+ #define SDL_PopError () \
284+ if (saved_error) { \
285+ SDL_SetError("%s", saved_error); \
286+ SDL_free(saved_error); \
287+ } \
288+ } while (0)
284289
285290#if defined(SDL_DISABLE_INVALID_PARAMS )
286291#ifdef DEBUG
Original file line number Diff line number Diff line change @@ -2584,9 +2584,9 @@ SDL_Window *SDL_CreateWindowWithProperties(SDL_PropertiesID props)
25842584 SDL_UpdateWindowHierarchy (window , parent );
25852585
25862586 if (_this -> CreateSDLWindow && !_this -> CreateSDLWindow (_this , window , props )) {
2587- PUSH_SDL_ERROR ()
2587+ SDL_PushError ();
25882588 SDL_DestroyWindow (window );
2589- POP_SDL_ERROR ()
2589+ SDL_PopError ();
25902590 return NULL ;
25912591 }
25922592
You can’t perform that action at this time.
0 commit comments