Allow return status to be specified using quitWithStatus.

This commit is contained in:
Daniel Buckmaster 2014-09-21 18:27:31 +10:00
parent d08e594316
commit 9f47032522
13 changed files with 52 additions and 18 deletions

View file

@ -1517,11 +1517,12 @@ ConsoleFunction( realQuit, void, 1, 1, "" )
//-----------------------------------------------------------------------------
DefineConsoleFunction( quitWithErrorMessage, void, ( const char* message ),,
DefineConsoleFunction( quitWithErrorMessage, void, ( const char* message, S32 status ), (0),
"Display an error message box showing the given @a message and then shut down the engine and exit its process.\n"
"This function cleanly uninitialized the engine and then exits back to the system with a process "
"exit status indicating an error.\n\n"
"@param message The message to log to the console and show in an error message box.\n\n"
"@param message The message to log to the console and show in an error message box.\n"
"@param status The status code to return to the OS.\n\n"
"@see quit\n\n"
"@ingroup Platform" )
{
@ -1532,7 +1533,20 @@ DefineConsoleFunction( quitWithErrorMessage, void, ( const char* message ),,
// as the script code should not be allowed to pretty much hard-crash the engine
// and prevent proper shutdown. Changed this to use postQuitMessage.
Platform::postQuitMessage( -1 );
Platform::postQuitMessage( status );
}
//-----------------------------------------------------------------------------
DefineConsoleFunction( quitWithStatus, void, ( S32 status ), (0),
"Shut down the engine and exit its process.\n"
"This function cleanly uninitializes the engine and then exits back to the system with a given "
"return status code.\n\n"
"@param status The status code to return to the OS.\n\n"
"@see quitWithErrorMessage\n\n"
"@ingroup Platform" )
{
Platform::postQuitMessage(status);
}
//-----------------------------------------------------------------------------