define __OPTIMIZE__ if -ON (N != 0)
this is gcc behaviour
This commit is contained in:
parent
c497f9c82c
commit
ff06d4258e
1 changed files with 9 additions and 0 deletions
9
libtcc.c
9
libtcc.c
|
@ -2048,6 +2048,15 @@ PUB_FUNC int tcc_parse_args(TCCState *s, int argc, char **argv)
|
||||||
tcc_warning("unsupported language '%s'", optarg);
|
tcc_warning("unsupported language '%s'", optarg);
|
||||||
break;
|
break;
|
||||||
case TCC_OPTION_O:
|
case TCC_OPTION_O:
|
||||||
|
if (1) {
|
||||||
|
int opt = atoi(optarg);
|
||||||
|
char *sym = "__OPTIMIZE__";
|
||||||
|
if (opt)
|
||||||
|
tcc_define_symbol(s, sym, 0);
|
||||||
|
else
|
||||||
|
tcc_undefine_symbol(s, sym);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case TCC_OPTION_pedantic:
|
case TCC_OPTION_pedantic:
|
||||||
case TCC_OPTION_pipe:
|
case TCC_OPTION_pipe:
|
||||||
/* ignored */
|
/* ignored */
|
||||||
|
|
Loading…
Reference in a new issue