aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/std.h
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-08-26 21:37:56 +0900
committernsfisis <nsfisis@gmail.com>2025-08-26 21:40:29 +0900
commita70bc7804c4c1cb07976d684b64b5a2fe3b68f93 (patch)
treec1689b04c232e61c0b7833756a9655636b00463c /src/std.h
parentb3b3c8bcd07e644fdba9167f927ad8dee4a255db (diff)
downloadducc-a70bc7804c4c1cb07976d684b64b5a2fe3b68f93.tar.gz
ducc-a70bc7804c4c1cb07976d684b64b5a2fe3b68f93.tar.zst
ducc-a70bc7804c4c1cb07976d684b64b5a2fe3b68f93.zip
refactor: preprocessing using helper functions
Diffstat (limited to 'src/std.h')
-rw-r--r--src/std.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/std.h b/src/std.h
index a2ab45e..0792ce4 100644
--- a/src/std.h
+++ b/src/std.h
@@ -36,6 +36,13 @@ char* strndup(const char*, size_t);
char* strstr(const char*, const char*);
int system(const char*);
+#define assert(x) \
+ do { \
+ if (!(x)) { \
+ fatal_error("%s:%d: assertion failed", __FILE__, __LINE__); \
+ } \
+ } while (0)
+
#include <stdarg.h>
int vfprintf(FILE*, const char*, va_list);