mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-28 07:45:40 +00:00
Update to SDL2.0.10
This commit is contained in:
parent
e916d14440
commit
9ebe30b7f8
915 changed files with 116675 additions and 21754 deletions
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
@ -120,20 +120,36 @@ static void SDL_GenerateAssertionReport(void)
|
|||
}
|
||||
|
||||
|
||||
#if defined(__WATCOMC__)
|
||||
#pragma aux SDL_ExitProcess aborts;
|
||||
#endif
|
||||
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. */
|
||||
exit(exitcode);
|
||||
#elif defined(__HAIKU__) /* Haiku has _Exit, but it's not marked noreturn. */
|
||||
_exit(exitcode);
|
||||
#elif defined(HAVE__EXIT) /* Upper case _Exit() */
|
||||
_Exit(exitcode);
|
||||
#else
|
||||
_exit(exitcode);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#if defined(__WATCOMC__)
|
||||
#pragma aux SDL_AbortAssertion aborts;
|
||||
#endif
|
||||
static SDL_NORETURN void SDL_AbortAssertion(void)
|
||||
{
|
||||
SDL_Quit();
|
||||
|
|
@ -168,6 +184,7 @@ SDL_PromptAssertion(const SDL_assert_data *data, void *userdata)
|
|||
|
||||
(void) userdata; /* unused in default handler. */
|
||||
|
||||
/* !!! FIXME: why is this using SDL_stack_alloc and not just "char message[SDL_MAX_LOG_MESSAGE];" ? */
|
||||
message = SDL_stack_alloc(char, SDL_MAX_LOG_MESSAGE);
|
||||
if (!message) {
|
||||
/* Uh oh, we're in real trouble now... */
|
||||
|
|
@ -239,7 +256,7 @@ SDL_PromptAssertion(const SDL_assert_data *data, void *userdata)
|
|||
SDL_bool okay = SDL_TRUE;
|
||||
char *buf = (char *) EM_ASM_INT({
|
||||
var str =
|
||||
Pointer_stringify($0) + '\n\n' +
|
||||
UTF8ToString($0) + '\n\n' +
|
||||
'Abort/Retry/Ignore/AlwaysIgnore? [ariA] :';
|
||||
var reply = window.prompt(str, "i");
|
||||
if (reply === null) {
|
||||
|
|
@ -359,10 +376,6 @@ SDL_ReportAssertion(SDL_assert_data *data, const char *func, const char *file,
|
|||
|
||||
switch (state)
|
||||
{
|
||||
case SDL_ASSERTION_ABORT:
|
||||
SDL_AbortAssertion();
|
||||
return SDL_ASSERTION_IGNORE; /* shouldn't return, but oh well. */
|
||||
|
||||
case SDL_ASSERTION_ALWAYS_IGNORE:
|
||||
state = SDL_ASSERTION_IGNORE;
|
||||
data->always_ignore = 1;
|
||||
|
|
@ -372,6 +385,10 @@ SDL_ReportAssertion(SDL_assert_data *data, const char *func, const char *file,
|
|||
case SDL_ASSERTION_RETRY:
|
||||
case SDL_ASSERTION_BREAK:
|
||||
break; /* macro handles these. */
|
||||
|
||||
case SDL_ASSERTION_ABORT:
|
||||
SDL_AbortAssertion();
|
||||
/*break; ...shouldn't return, but oh well. */
|
||||
}
|
||||
|
||||
assertion_running--;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue