From f5a347853dd4509321b8da3b539ac356bb18aa36 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 11 Jun 2019 21:57:30 -0400 Subject: [PATCH] assert: mark SDL_ExitProcess as SDL_NORETURN again. Put in a hack to (hopefully) make MingW happy. Fixes Bugzilla #4100. --- src/SDL_assert.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/SDL_assert.c b/src/SDL_assert.c index 6282015af2896..7d6534e312001 100644 --- a/src/SDL_assert.c +++ b/src/SDL_assert.c @@ -123,14 +123,16 @@ static void SDL_GenerateAssertionReport(void) #if defined(__WATCOMC__) #pragma aux SDL_ExitProcess aborts; #endif -static void SDL_ExitProcess(int exitcode) +static SDL_NORETURN void SDL_ExitProcess(int exitcode) { #ifdef __WIN32__ /* "if you do not know the state of all threads in your process, it is better to call TerminateProcess than ExitProcess" https://msdn.microsoft.com/en-us/library/windows/desktop/ms682658(v=vs.85).aspx */ TerminateProcess(GetCurrentProcess(), exitcode); - + /* MingW doesn't have TerminateProcess marked as noreturn, so add an + ExitProcess here that will never be reached but make MingW happy. */ + ExitProcess(exitcode); #elif defined(__EMSCRIPTEN__) emscripten_cancel_main_loop(); /* this should "kill" the app. */ emscripten_force_exit(exitcode); /* this should "kill" the app. */