mirror of
git://repo.or.cz/tinycc.git
synced 2026-06-22 21:04:19 +08:00
Add more STDC_ C11 compatible constants
This commit is contained in:
parent
ecb90de4cc
commit
d44d8cdf60
85
libtcc.c
85
libtcc.c
@ -1793,35 +1793,62 @@ reparse:
|
|||||||
case TCC_OPTION_std:
|
case TCC_OPTION_std:
|
||||||
if (*optarg == '=') {
|
if (*optarg == '=') {
|
||||||
if (strcmp(optarg, "=c11") == 0) {
|
if (strcmp(optarg, "=c11") == 0) {
|
||||||
tcc_undefine_symbol(s, "__STDC_VERSION__");
|
tcc_undefine_symbol(s, "__STDC_VERSION__");
|
||||||
tcc_define_symbol(s, "__STDC_VERSION__", "201112L");
|
tcc_define_symbol(s, "__STDC_VERSION__", "201112L");
|
||||||
/*
|
/*
|
||||||
* The integer constant 1, intended to indicate
|
* The integer constant 1, intended to indicate
|
||||||
* that the implementation does not support atomic
|
* that the implementation does not support atomic
|
||||||
* types (including the _Atomic type qualifier) and
|
* types (including the _Atomic type qualifier) and
|
||||||
* the <stdatomic.h> header.
|
* the <stdatomic.h> header.
|
||||||
*/
|
*/
|
||||||
tcc_define_symbol(s, "__STDC_NO_ATOMICS__", "1");
|
tcc_define_symbol(s, "__STDC_NO_ATOMICS__", "1");
|
||||||
/*
|
/*
|
||||||
* The integer constant 1, intended to indicate
|
* The integer constant 1, intended to indicate
|
||||||
* that the implementation does not support complex
|
* that the implementation does not support complex
|
||||||
* types or the <complex.h> header.
|
* types or the <complex.h> header.
|
||||||
*/
|
*/
|
||||||
tcc_define_symbol(s, "__STDC_NO_COMPLEX__", "1");
|
tcc_define_symbol(s, "__STDC_NO_COMPLEX__", "1");
|
||||||
/*
|
/*
|
||||||
* The integer constant 1, intended to indicate
|
* The integer constant 1, intended to indicate
|
||||||
* that the implementation does not support the
|
* that the implementation does not support the
|
||||||
* <threads.h> header.
|
* <threads.h> header.
|
||||||
*/
|
*/
|
||||||
tcc_define_symbol(s, "__STDC_NO_THREADS__", "1");
|
tcc_define_symbol(s, "__STDC_NO_THREADS__", "1");
|
||||||
/*
|
/*
|
||||||
* __STDC_NO_VLA__, tcc supports VLA.
|
* __STDC_NO_VLA__, tcc supports VLA.
|
||||||
* The integer constant 1, intended to indicate
|
* The integer constant 1, intended to indicate
|
||||||
* that the implementation does not support
|
* that the implementation does not support
|
||||||
* variable length arrays or variably modified
|
* variable length arrays or variably modified
|
||||||
* types.
|
* types.
|
||||||
*/
|
*/
|
||||||
s->cversion = 201112;
|
#if !defined(TCC_TARGET_PE)
|
||||||
|
/*
|
||||||
|
* An integer constant of the form yyyymmL (for
|
||||||
|
* example, 199712L). If this symbol is defined,
|
||||||
|
* then every character in the Unicode required
|
||||||
|
* set, when stored in an object of type
|
||||||
|
* wchar_t, has the same value as the short
|
||||||
|
* identifier of that character.
|
||||||
|
*/
|
||||||
|
tcc_define_symbol(s, "__STDC_ISO_10646__", "201605L");
|
||||||
|
/*
|
||||||
|
* The integer constant 1, intended to indicate
|
||||||
|
* that values of type char16_t are UTF−16
|
||||||
|
* encoded. If some other encoding is used, the
|
||||||
|
* macro shall not be defined and the actual
|
||||||
|
* encoding used is implementation defined.
|
||||||
|
*/
|
||||||
|
tcc_define_symbol(s, "__STDC_UTF_16__", "1");
|
||||||
|
/*
|
||||||
|
* The integer constant 1, intended to indicate
|
||||||
|
* that values of type char32_t are UTF−32
|
||||||
|
* encoded. If some other encoding is used, the
|
||||||
|
* macro shall not be defined and the actual
|
||||||
|
* encoding used is implementationdefined.
|
||||||
|
*/
|
||||||
|
tcc_define_symbol(s, "__STDC_UTF_32__", "1");
|
||||||
|
#endif /* !TCC_TARGET_PE */
|
||||||
|
s->cversion = 201112;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user