aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib/util.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-04-16 13:58:37 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-04-16 13:58:37 -0400
commit43f8c072241e162283751c28de18dc4658470d6e (patch)
tree96d01ed12d13768672c8f903935dd97fc9d91539 /src/stdlib/util.h
parent7b1b9afc9e5ce7f044958add4817b009db29caf4 (diff)
Automatically add return for unreachable code blocks (following a
_Noreturn) to make TinyCC happy
Diffstat (limited to 'src/stdlib/util.h')
-rw-r--r--src/stdlib/util.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/stdlib/util.h b/src/stdlib/util.h
index 25cd49f9..e54c1cab 100644
--- a/src/stdlib/util.h
+++ b/src/stdlib/util.h
@@ -21,6 +21,8 @@
#define WHEN(type, subj, var, body) { type var = subj; switch (var.$tag) body }
+#define UNREACHABLE_RETURN(t) { errx(1, "Unreachable"); t _unreachable; return _unreachable; }
+
#ifndef public
#define public __attribute__ ((visibility ("default")))
#endif