-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Add SDL_abort macro #13978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SDL_abort macro #13978
Conversation
src/SDL_internal.h
Outdated
#ifdef HAVE_LIBC | ||
#define SDL_abort() abort() | ||
#else | ||
#define SDL_abort() do { \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want to declare SDL_ExitProcess
outside the block scope. If I remember right, some compilers don't like that. Do we need the __WATCOMC__
stuff here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was hesitant about doing that because of this comment. Or perhaps this comment is talking about the public headers.
/* This is not declared in any header, although it is shared between some
parts of SDL, because we don't want anything calling it without an
extremely good reason. */
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can Watcom compile SDL3 for Windows/Linux? @sezero
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if I can declare SDL_ExitProcess
in SDL_internal.h
, then I can just keep the watcom code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Sorry for late reply - noticed this one late.)
Can Watcom compile SDL3 for Windows/Linux? @sezero
Never tested building sdl3 itself using watcom, and never will: unsupported. So, watcom stuff can be removed from private sdl3 sources.
P.S.: Headers are still compatible, though: sdl2-compat can still build for windows using watcom.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, watcom stuff can be removed from private sdl3 sources.
... and just did that with 9cefbab
a874534
to
0851fe0
Compare
0851fe0
to
c014e49
Compare
Using the non-libc
SDL_abort
instead ofabort
on Linux gives the same developer experience:The debugger immediately jump to the
SDL_abort
location.This is why
SDL_abort
is a macro instead of an inline/extern function.The only observable difference is the signal triggering the debugger, and what's printed on the terminal on abort.
abort
from libc:abort
usingSDL_TriggerBreakpoint
+SDL_ExitProcess
:Description
Existing Issue(s)
Fixes #13968