From f6e34f84e14ac5f272cb31e28e2f023acf702a99 Mon Sep 17 00:00:00 2001 From: lemon Date: Thu, 11 Dec 2025 12:28:32 +0100 Subject: fatal() make noreturn --- common.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/common.h b/common.h index 2d2eb79..d363038 100644 --- a/common.h +++ b/common.h @@ -16,7 +16,13 @@ typedef unsigned short ushort; typedef unsigned long long uvlong; typedef signed long long vlong; typedef unsigned uint; - +#if __STDC_VERSION__ >= 202311L +#define NORETURN [[noreturn]] +#elif __STDC_VERSION__ >= 201112L +#define NORETURN _Noreturn +#else +#define NORETURN +#endif #ifdef __has_builtin #define HAS_BUILTIN(b) __has_builtin(__builtin_##b) @@ -389,7 +395,7 @@ void markfileonce(int id, const char *guard); void markfileseen(int id); bool isfileseen(int id); void closefile(int id); -_Noreturn void fatal(const struct span *, const char *, ...); +NORETURN void fatal(const struct span *, const char *, ...); void error(const struct span *, const char *, ...); void warn(const struct span *, const char *, ...); void note(const struct span *, const char *, ...); -- cgit v1.2.3