mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-30 06:58:30 +00:00
Use SDL_abort when encountering a internal fatal SDL_assertion error
This commit is contained in:

committed by
Anonymous Maarten

parent
a7739ceccb
commit
5dfa2cb88a
@@ -120,15 +120,6 @@ static void SDL_GenerateAssertionReport(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This is not declared in any 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 __WATCOMC__
|
#ifdef __WATCOMC__
|
||||||
static void SDL_AbortAssertion(void);
|
static void SDL_AbortAssertion(void);
|
||||||
#pragma aux SDL_AbortAssertion aborts;
|
#pragma aux SDL_AbortAssertion aborts;
|
||||||
@@ -136,7 +127,7 @@ static void SDL_AbortAssertion(void);
|
|||||||
static SDL_NORETURN void SDL_AbortAssertion(void)
|
static SDL_NORETURN void SDL_AbortAssertion(void)
|
||||||
{
|
{
|
||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
SDL_ExitProcess(42);
|
SDL_abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
static SDL_AssertState SDLCALL SDL_PromptAssertion(const SDL_AssertData *data, void *userdata)
|
static SDL_AssertState SDLCALL SDL_PromptAssertion(const SDL_AssertData *data, void *userdata)
|
||||||
@@ -361,7 +352,7 @@ SDL_AssertState SDL_ReportAssertion(SDL_AssertData *data, const char *func, cons
|
|||||||
if (assertion_running == 2) {
|
if (assertion_running == 2) {
|
||||||
SDL_AbortAssertion();
|
SDL_AbortAssertion();
|
||||||
} else if (assertion_running == 3) { // Abort asserted!
|
} else if (assertion_running == 3) { // Abort asserted!
|
||||||
SDL_ExitProcess(42);
|
SDL_abort();
|
||||||
} else {
|
} else {
|
||||||
while (1) { // do nothing but spin; what else can you do?!
|
while (1) { // do nothing but spin; what else can you do?!
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user