mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-23 03:22:08 +00:00
Improve helpers.h
Use C11 standard _Noreturn instead of attributes (except, of course, MSVC) Remove unused helpers Avoid trapping in release builds, in favor of just unreachability Improve shim when __builtin_* are not available
This commit is contained in:
8
src/extern/err.c
vendored
8
src/extern/err.c
vendored
@@ -34,7 +34,7 @@ void rgbds_vwarnx(const char *fmt, va_list ap)
|
||||
putc('\n', stderr);
|
||||
}
|
||||
|
||||
noreturn_ void rgbds_verr(int status, const char *fmt, va_list ap)
|
||||
_Noreturn void rgbds_verr(int status, const char *fmt, va_list ap)
|
||||
{
|
||||
fprintf(stderr, "error: ");
|
||||
if (fmt) {
|
||||
@@ -46,7 +46,7 @@ noreturn_ void rgbds_verr(int status, const char *fmt, va_list ap)
|
||||
exit(status);
|
||||
}
|
||||
|
||||
noreturn_ void rgbds_verrx(int status, const char *fmt, va_list ap)
|
||||
_Noreturn void rgbds_verrx(int status, const char *fmt, va_list ap)
|
||||
{
|
||||
fprintf(stderr, "error");
|
||||
if (fmt) {
|
||||
@@ -75,7 +75,7 @@ void rgbds_warnx(const char *fmt, ...)
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
noreturn_ void rgbds_err(int status, const char *fmt, ...)
|
||||
_Noreturn void rgbds_err(int status, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
@@ -84,7 +84,7 @@ noreturn_ void rgbds_err(int status, const char *fmt, ...)
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
noreturn_ void rgbds_errx(int status, const char *fmt, ...)
|
||||
_Noreturn void rgbds_errx(int status, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user