Skip to content

Commit d246a58

Browse files
committed
Add SDL_internal macro for internal use
1 parent 3876ce3 commit d246a58

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/SDL_internal.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,25 @@
133133
#include <float.h>
134134
#endif
135135

136+
/* SDL_ExitProcess is not declared in any public header, although
137+
it is shared between some parts of SDL, because we don't want
138+
anything calling it without an extremely good reason. */
139+
#ifdef __WATCOMC__
140+
extern void SDL_ExitProcess(int exitcode);
141+
#pragma aux SDL_ExitProcess aborts;
142+
#endif
143+
extern SDL_NORETURN void SDL_ExitProcess(int exitcode);
144+
145+
#ifdef HAVE_LIBC
146+
#define SDL_abort() abort()
147+
#else
148+
149+
#define SDL_abort() do { \
150+
SDL_TriggerBreakpoint(); \
151+
SDL_ExitProcess(42); \
152+
} while (0)
153+
#endif
154+
136155
// If you run into a warning that O_CLOEXEC is redefined, update the SDL configuration header for your platform to add HAVE_O_CLOEXEC
137156
#ifndef HAVE_O_CLOEXEC
138157
#define O_CLOEXEC 0

0 commit comments

Comments
 (0)