Add _DEFAULT_SOURCE to all CFLAGS (mongoose, grammars) for Linux POSIX compat

This commit is contained in:
Martin Vogel
2026-03-18 00:28:13 +01:00
parent 1957612469
commit 0aabc447f6
+5 -5
View File
@@ -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