expand support for noreturn declarations

Although gcc specifies support for declaring a function as
noreturn after the function name and parameters, other compilers
do so via an attribute at the start of the declaration. Add some
macro support for the attribute-at-the-beginning method:
  o MS Visual Studio compiler
  o Upcoming C23 standard (untested at this point)
This commit is contained in:
nhmall
2022-11-24 00:51:42 -05:00
parent ddf1dfde29
commit 4b04b1e6ac
13 changed files with 173 additions and 19 deletions

View File

@@ -596,7 +596,7 @@ fixup_death(int how)
DISABLE_WARNING_FORMAT_NONLITERAL
/*VARARGS1*/
void
ATTRNORETURN void
panic VA_DECL(const char *, str)
{
VA_START(str);
@@ -1780,7 +1780,7 @@ container_contents(
}
/* should be called with either EXIT_SUCCESS or EXIT_FAILURE */
void
ATTRNORETURN void
nh_terminate(int status)
{
g.program_state.in_moveloop = 0; /* won't be returning to normal play */