assert: mark SDL_ExitProcess as SDL_NORETURN again.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 11 Jun 2019 21:57:30 -0400
changeset 128418a0e446a4cf9
parent 12840 1b6f67e84802
child 12842 a66900915e4e
assert: mark SDL_ExitProcess as SDL_NORETURN again.

Put in a hack to (hopefully) make MingW happy.

Fixes Bugzilla #4100.
src/SDL_assert.c
     1.1 --- a/src/SDL_assert.c	Tue Jun 11 16:19:01 2019 -0400
     1.2 +++ b/src/SDL_assert.c	Tue Jun 11 21:57:30 2019 -0400
     1.3 @@ -123,14 +123,16 @@
     1.4  #if defined(__WATCOMC__)
     1.5  #pragma aux SDL_ExitProcess aborts;
     1.6  #endif
     1.7 -static void SDL_ExitProcess(int exitcode)
     1.8 +static SDL_NORETURN void SDL_ExitProcess(int exitcode)
     1.9  {
    1.10  #ifdef __WIN32__
    1.11      /* "if you do not know the state of all threads in your process, it is
    1.12         better to call TerminateProcess than ExitProcess"
    1.13         https://msdn.microsoft.com/en-us/library/windows/desktop/ms682658(v=vs.85).aspx */
    1.14      TerminateProcess(GetCurrentProcess(), exitcode);
    1.15 -
    1.16 +    /* MingW doesn't have TerminateProcess marked as noreturn, so add an
    1.17 +       ExitProcess here that will never be reached but make MingW happy. */
    1.18 +    ExitProcess(exitcode);
    1.19  #elif defined(__EMSCRIPTEN__)
    1.20      emscripten_cancel_main_loop();  /* this should "kill" the app. */
    1.21      emscripten_force_exit(exitcode);  /* this should "kill" the app. */