aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-12-11 12:28:32 +0100
committerlemon <lsof@mailbox.org>2025-12-11 12:28:32 +0100
commitf6e34f84e14ac5f272cb31e28e2f023acf702a99 (patch)
tree6a00e53fd4a35a558bfd0cb50329b7fdbf3d3145
parent744705931dd6522a69a4d41e1bc5af9e87262255 (diff)
fatal() make noreturn
-rw-r--r--common.h10
1 files 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 *, ...);