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

@@ -2316,6 +2316,8 @@ write_timer(NHFILE* nhfp, timer_element* timer)
}
}
DISABLE_WARNING_UNREACHABLE_CODE
/*
* Return TRUE if the object will stay on the level when the level is
* saved.
@@ -2336,6 +2338,7 @@ obj_is_local(struct obj* obj)
return mon_is_local(obj->ocarry);
}
panic("obj_is_local");
/*NOTREACHED*/
return FALSE;
}
@@ -2376,9 +2379,12 @@ timer_is_local(timer_element* timer)
return mon_is_local(timer->arg.a_monst);
}
panic("timer_is_local");
/*NOTREACHED*/
return FALSE;
}
RESTORE_WARNING_UNREACHABLE_CODE
/*
* Part of the save routine. Count up the number of timers that would
* be written. If write_it is true, actually write the timer.