From a70bc7804c4c1cb07976d684b64b5a2fe3b68f93 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 26 Aug 2025 21:37:56 +0900 Subject: refactor: preprocessing using helper functions --- src/std.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/std.h') 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 int vfprintf(FILE*, const char*, va_list); -- cgit v1.2.3-70-g09d2