From cdebce3079a5c5526d2122662f2aaf5fe1fc0209 Mon Sep 17 00:00:00 2001 From: Detlef Riekenberg Date: Sat, 1 Nov 2025 18:11:49 +0100 Subject: [PATCH] tccpp: Add the define __STDC_HOSTED__ [C99] Usually defined to 1, but when using "-nostdlib", the value is 0 (required for C99) -- Regards ... Detlef --- tccpp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tccpp.c b/tccpp.c index 96385f5f..cd1ed9cc 100644 --- a/tccpp.c +++ b/tccpp.c @@ -3737,6 +3737,7 @@ static void tcc_predefs(TCCState *s1, CString *cs, int is_asm) cstr_printf(cs, "#define __SIZEOF_LONG__ %d\n", LONG_SIZE); if (!is_asm) { putdef(cs, "__STDC__"); + cstr_printf(cs, "#define __STDC_HOSTED__ %d\n", s1->nostdlib ? 0 : 1); cstr_printf(cs, "#define __STDC_VERSION__ %dL\n", s1->cversion); cstr_cat(cs, /* load more predefs and __builtins */