define __OPTIMIZE__ if -ON (N != 0)
this is gcc behaviour
This commit is contained in:
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 */
|
||||||
|
|||||||
Reference in New Issue
Block a user