define __OPTIMIZE__ if -ON (N != 0)

this is gcc behaviour
master
seyko 2015-05-10 10:21:37 +03:00
parent c497f9c82c
commit ff06d4258e
1 changed files with 9 additions and 0 deletions

View File

@ -2048,6 +2048,15 @@ PUB_FUNC int tcc_parse_args(TCCState *s, int argc, char **argv)
tcc_warning("unsupported language '%s'", optarg);
break;
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_pipe:
/* ignored */