turn I_Error() into an actual NORETURN function

This commit is contained in:
Fabian Greffrath 2021-02-03 16:41:46 +01:00
parent d68862a79f
commit 05aa665373
2 changed files with 11 additions and 6 deletions

View File

@ -349,6 +349,15 @@ void I_Error(const char *error, ...) // killough 3/20/98: add const
{
boolean exit_gui_popup;
if (has_exited) // If it hasn't exited yet, exit now -- killough
{
exit(-1);
}
else
{
has_exited=1; // Prevent infinitely recursive exits -- killough
}
if(!*errmsg) // ignore all but the first message -- killough
{
va_list argptr;
@ -370,11 +379,7 @@ void I_Error(const char *error, ...) // killough 3/20/98: add const
PROJECT_STRING, errmsg, NULL);
}
if(!has_exited) // If it hasn't exited yet, exit now -- killough
{
has_exited=1; // Prevent infinitely recursive exits -- killough
exit(-1);
}
exit(-1);
}
// killough 2/22/98: Add support for ENDBOOM, which is PC-specific

View File

@ -90,7 +90,7 @@ void I_Quit (void);
// killough 3/20/98: add const
// killough 4/25/98: add gcc attributes
void I_Error(const char *error, ...) PRINTF_ATTR(1, 2);
void I_Error(const char *error, ...) NORETURN PRINTF_ATTR(1, 2);
extern int leds_always_off; // killough 10/98