Просмотр исходного кода

Add SDL_internal macro for internal use

Anonymous Maarten 2 дней назад
Родитель
Сommit
a7739ceccb
1 измененных файлов с 18 добавлено и 0 удалено
  1. 18 0
      src/SDL_internal.h

+ 18 - 0
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());