From 0aabc447f6b67185ca2b9bf8618a7f210ea3377a Mon Sep 17 00:00:00 2001 From: Martin Vogel Date: Wed, 18 Mar 2026 00:28:13 +0100 Subject: [PATCH] Add _DEFAULT_SOURCE to all CFLAGS (mongoose, grammars) for Linux POSIX compat --- Makefile.cbm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile.cbm b/Makefile.cbm index 6d51de44b..656c3efbe 100644 --- a/Makefile.cbm +++ b/Makefile.cbm @@ -174,8 +174,8 @@ UI_SRCS = \ # Mongoose HTTP library (vendored, compiled with relaxed warnings) MONGOOSE_SRC = vendored/mongoose/mongoose.c -MONGOOSE_CFLAGS = -std=c11 -O2 -w -Ivendored -DMG_ENABLE_LOG=0 -MONGOOSE_CFLAGS_TEST = -std=c11 -g -O1 -w -Ivendored -DMG_ENABLE_LOG=0 \ +MONGOOSE_CFLAGS = -std=c11 -D_DEFAULT_SOURCE -O2 -w -Ivendored -DMG_ENABLE_LOG=0 +MONGOOSE_CFLAGS_TEST = -std=c11 -D_DEFAULT_SOURCE -g -O1 -w -Ivendored -DMG_ENABLE_LOG=0 \ -fsanitize=address,undefined -fno-omit-frame-pointer # mimalloc (vendored, global allocator override) @@ -265,10 +265,10 @@ BUILD_DIR = build/c # ── Object file compilation (grammars need relaxed warnings) ───── # Grammar + tree-sitter runtime: compiled without -Werror (upstream code has warnings) -GRAMMAR_CFLAGS = -std=c11 -O2 -w -I$(CBM_DIR) -I$(TS_INCLUDE) -GRAMMAR_CFLAGS_TEST = -std=c11 -g -O1 -w -I$(CBM_DIR) -I$(TS_INCLUDE) \ +GRAMMAR_CFLAGS = -std=c11 -D_DEFAULT_SOURCE -O2 -w -I$(CBM_DIR) -I$(TS_INCLUDE) +GRAMMAR_CFLAGS_TEST = -std=c11 -D_DEFAULT_SOURCE -g -O1 -w -I$(CBM_DIR) -I$(TS_INCLUDE) \ -fsanitize=address,undefined -fno-omit-frame-pointer -GRAMMAR_CFLAGS_TSAN = -std=c11 -g -O1 -w -I$(CBM_DIR) -I$(TS_INCLUDE) \ +GRAMMAR_CFLAGS_TSAN = -std=c11 -D_DEFAULT_SOURCE -g -O1 -w -I$(CBM_DIR) -I$(TS_INCLUDE) \ -fsanitize=thread -fno-omit-frame-pointer # Object files for grammars + ts_runtime + lsp_all + preprocessor