tccpp: Add the define __STDC_HOSTED__ [C99]
Some checks are pending
build and test / test-x86_64-linux (push) Waiting to run
build and test / test-x86_64-osx (push) Waiting to run
build and test / test-aarch64-osx (push) Waiting to run
build and test / test-x86_64-win32 (push) Waiting to run
build and test / test-i386-win32 (push) Waiting to run
build and test / test-armv7-linux (push) Waiting to run
build and test / test-aarch64-linux (push) Waiting to run
build and test / test-riscv64-linux (push) Waiting to run

Usually defined to 1, but when using "-nostdlib", the value is 0
(required for C99)

--
Regards ... Detlef
This commit is contained in:
Detlef Riekenberg 2025-11-01 18:11:49 +01:00
parent f4e01bfcab
commit cdebce3079

View File

@ -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 */