From a7739ceccbaa711e34740a405f3ed5cf87673e83 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Wed, 17 Sep 2025 19:24:02 +0200 Subject: [PATCH] Add SDL_internal macro for internal use --- src/SDL_internal.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/SDL_internal.h b/src/SDL_internal.h index 0d5d203f8f..3d027f794b 100644 --- a/src/SDL_internal.h +++ b/src/SDL_internal.h @@ -266,6 +266,24 @@ extern "C" { #include "SDL_utils_c.h" #include "SDL_hashtable.h" +/* SDL_ExitProcess is not declared in any public header, although + it is shared between some parts of SDL, because we don't want + anything calling it without an extremely good reason. */ +#ifdef __WATCOMC__ +extern void SDL_ExitProcess(int exitcode); +#pragma aux SDL_ExitProcess aborts; +#endif +extern SDL_NORETURN void SDL_ExitProcess(int exitcode); + +#ifdef HAVE_LIBC +#define SDL_abort() abort() +#else +#define SDL_abort() do { \ + SDL_TriggerBreakpoint(); \ + SDL_ExitProcess(42); \ + } while (0) +#endif + #define PUSH_SDL_ERROR() \ { char *_error = SDL_strdup(SDL_GetError());