Unified · Split
| @@ -805,6 +805,11 @@ LIBTCCAPI TCCState *tcc_new(void) · 804 unmodified lines | ||
| 805 | 805 | tcc_define_symbol(s, "__STDC_VERSION__", "199901L"); |
| 806 | 806 | tcc_define_symbol(s, "__STDC_HOSTED__", NULL); |
| 807 | 807 | |
| 808 | +#if !defined(TCC_TARGET_PE) | |
| 809 | + /* glibc compatible macro (default for C99) */ | |
| 810 | + tcc_define_symbol(s, "_ISOC99_SOURCE", "1"); | |
| 811 | +#endif | |
| 812 | + | |
| 808 | 813 | /* target defines */ |
| 809 | 814 | #if defined(TCC_TARGET_I386) |
| 810 | 815 | tcc_define_symbol(s, "__i386__", NULL); |
| @@ -1900,6 +1905,11 @@ reparse: · 1089 unmodified lines | ||
| 1900 | 1905 | * encoding used is implementationdefined. |
| 1901 | 1906 | */ |
| 1902 | 1907 | tcc_define_symbol(s, "__STDC_UTF_32__", "1"); |
| 1908 | + /* | |
| 1909 | + * glibc compatible macro used when -std=c11 is used. | |
| 1910 | + * _ISOC99_SOURCE remains defined as does gcc. | |
| 1911 | + */ | |
| 1912 | + tcc_define_symbol(s, "_ISOC11_SOURCE", "1"); | |
| 1903 | 1913 | #endif /* !TCC_TARGET_PE */ |
| 1904 | 1914 | s->cversion = 201112; |
| 1905 | 1915 | } |