From 55f2e9c33f8e61e19da4a52fc6a04cdf7dd770c4 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 4 May 2025 15:43:47 +0900 Subject: define NULL --- main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index 6e90c75..c8431b1 100644 --- a/main.c +++ b/main.c @@ -16,6 +16,8 @@ int strcmp(); char* strstr(); long strtol(); +#define NULL 0 + void fatal_error(char* msg) { printf("%s\n", msg); exit(1); @@ -774,7 +776,7 @@ AST* parse_if_stmt(PARSER* p) { AST* cond = parse_expr(p); expect(p, TK_PAREN_R); AST* then_body = parse_stmt(p); - AST* else_body = 0; + AST* else_body = NULL; if (peek_token(p)->kind == TK_K_ELSE) { next_token(p); else_body = parse_stmt(p); -- cgit v1.2.3-70-g09d2