mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-15 05:20:06 +08:00
Add _ISOCxx_SOURCE glibc compatible macros.
This commit is contained in:
parent
65f2fe390c
commit
c7e3d5d7a3
10
libtcc.c
10
libtcc.c
@ -805,6 +805,11 @@ LIBTCCAPI TCCState *tcc_new(void)
|
|||||||
tcc_define_symbol(s, "__STDC_VERSION__", "199901L");
|
tcc_define_symbol(s, "__STDC_VERSION__", "199901L");
|
||||||
tcc_define_symbol(s, "__STDC_HOSTED__", NULL);
|
tcc_define_symbol(s, "__STDC_HOSTED__", NULL);
|
||||||
|
|
||||||
|
#if !defined(TCC_TARGET_PE)
|
||||||
|
/* glibc compatible macro (default for C99) */
|
||||||
|
tcc_define_symbol(s, "_ISOC99_SOURCE", "1");
|
||||||
|
#endif
|
||||||
|
|
||||||
/* target defines */
|
/* target defines */
|
||||||
#if defined(TCC_TARGET_I386)
|
#if defined(TCC_TARGET_I386)
|
||||||
tcc_define_symbol(s, "__i386__", NULL);
|
tcc_define_symbol(s, "__i386__", NULL);
|
||||||
@ -1900,6 +1905,11 @@ reparse:
|
|||||||
* encoding used is implementationdefined.
|
* encoding used is implementationdefined.
|
||||||
*/
|
*/
|
||||||
tcc_define_symbol(s, "__STDC_UTF_32__", "1");
|
tcc_define_symbol(s, "__STDC_UTF_32__", "1");
|
||||||
|
/*
|
||||||
|
* glibc compatible macro used when -std=c11 is used.
|
||||||
|
* _ISOC99_SOURCE remains defined as does gcc.
|
||||||
|
*/
|
||||||
|
tcc_define_symbol(s, "_ISOC11_SOURCE", "1");
|
||||||
#endif /* !TCC_TARGET_PE */
|
#endif /* !TCC_TARGET_PE */
|
||||||
s->cversion = 201112;
|
s->cversion = 201112;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user