Skip to content

Commit cdebce3

Browse files
committed
tccpp: Add the define __STDC_HOSTED__ [C99]
Usually defined to 1, but when using "-nostdlib", the value is 0 (required for C99) -- Regards ... Detlef
1 parent f4e01bf commit cdebce3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tccpp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3737,6 +3737,7 @@ static void tcc_predefs(TCCState *s1, CString *cs, int is_asm)
37373737
cstr_printf(cs, "#define __SIZEOF_LONG__ %d\n", LONG_SIZE);
37383738
if (!is_asm) {
37393739
putdef(cs, "__STDC__");
3740+
cstr_printf(cs, "#define __STDC_HOSTED__ %d\n", s1->nostdlib ? 0 : 1);
37403741
cstr_printf(cs, "#define __STDC_VERSION__ %dL\n", s1->cversion);
37413742
cstr_cat(cs,
37423743
/* load more predefs and __builtins */

0 commit comments

Comments
 (0)