summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/panic.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/panic.h b/include/panic.h
new file mode 100644
index 0000000..21715fd
--- /dev/null
+++ b/include/panic.h
@@ -0,0 +1,8 @@
+#pragma once
+
+#define _PANIC_STR(x) _PANIC_STR2(x)
+#define _PANIC_STR2(x) #x
+
+#define panic(msg) _panic_impl(_PANIC_STR(__LINE__), __FILE__, msg)
+
+_Noreturn void _panic_impl(char *line, char *file, char *msg);