summaryrefslogtreecommitdiff
path: root/std/core.zc
diff options
context:
space:
mode:
authorZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-13 01:01:40 +0000
committerZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-13 01:01:40 +0000
commitec9797df2a589d0a8cd36beb632956a1ec1f6bfc (patch)
tree553087b54a28fe576b321066e32854ae98ce58e9 /std/core.zc
parente8fceff49dc2414536a7deeb2adc6ffbfc7d413e (diff)
More general solution #15
Diffstat (limited to 'std/core.zc')
-rw-r--r--std/core.zc11
1 files changed, 10 insertions, 1 deletions
diff --git a/std/core.zc b/std/core.zc
index bfa82ea..910bfa6 100644
--- a/std/core.zc
+++ b/std/core.zc
@@ -5,4 +5,13 @@ include <stdio.h>
include <stdbool.h>
include <stdarg.h>
-var __zen_hash_seed: usize = 14695981039346656037; \ No newline at end of file
+var __zen_hash_seed: usize = 14695981039346656037;
+
+raw {
+void _zen_panic(const char* file, int line, const char* func, const char* msg) {
+ fprintf(stderr, "%s:%d (%s): Panic: %s\n", file, line, func, msg);
+ exit(1);
+}
+}
+
+#define panic(msg) _zen_panic(__FILE__, __LINE__, __func__, msg) \ No newline at end of file