mirror of
https://github.com/frida/tinycc
synced 2024-12-25 06:26:49 +03:00
Add __STDC_xxx test features related to ISO/IEC C11 when -std=c11 is passed.
This commit is contained in:
parent
065a3b35fc
commit
8482f9e54b
35
libtcc.c
35
libtcc.c
@ -1792,15 +1792,42 @@ reparse:
|
||||
break;
|
||||
case TCC_OPTION_std:
|
||||
if (*optarg == '=') {
|
||||
++optarg;
|
||||
if (strcmp(optarg, "c11") == 0) {
|
||||
if (strcmp(optarg, "=c11") == 0) {
|
||||
tcc_undefine_symbol(s, "__STDC_VERSION__");
|
||||
tcc_define_symbol(s, "__STDC_VERSION__", "201112L");
|
||||
/*
|
||||
* The integer constant 1, intended to indicate
|
||||
* that the implementation does not support atomic
|
||||
* types (including the _Atomic type qualifier) and
|
||||
* the <stdatomic.h> header.
|
||||
*/
|
||||
tcc_define_symbol(s, "__STDC_NO_ATOMICS__", "1");
|
||||
/*
|
||||
* The integer constant 1, intended to indicate
|
||||
* that the implementation does not support complex
|
||||
* types or the <complex.h> header.
|
||||
*/
|
||||
tcc_define_symbol(s, "__STDC_NO_COMPLEX__", "1");
|
||||
/*
|
||||
* The integer constant 1, intended to indicate
|
||||
* that the implementation does not support the
|
||||
* <threads.h> header.
|
||||
*/
|
||||
tcc_define_symbol(s, "__STDC_NO_THREADS__", "1");
|
||||
/*
|
||||
* __STDC_NO_VLA__, tcc supports VLA.
|
||||
* The integer constant 1, intended to indicate
|
||||
* that the implementation does not support
|
||||
* variable length arrays or variably modified
|
||||
* types.
|
||||
*/
|
||||
s->cversion = 201112;
|
||||
}
|
||||
}
|
||||
/* silently ignore other values, a current purpose:
|
||||
allow to use a tcc as a reference compiler for "make test" */
|
||||
/*
|
||||
* silently ignore other values, a current purpose:
|
||||
* allow to use a tcc as a reference compiler for "make test"
|
||||
*/
|
||||
break;
|
||||
case TCC_OPTION_shared:
|
||||
x = TCC_OUTPUT_DLL;
|
||||
|
Loading…
Reference in New Issue
Block a user