History

define __OPTIMIZE__ if -ON (N != 0)

this is gcc behaviour

seyko committed 11 years ago

Commit ff06d421 parent c497f9c1 file · +9 −0Browse files

Unified · Split

libtcc.c+9−0
@@ -2048,6 +2048,15 @@ PUB_FUNC int tcc_parse_args(TCCState *s, int argc, char **argv) · 2047 unmodified lines
20482048 tcc_warning("unsupported language '%s'", optarg);
20492049 break;
20502050 case TCC_OPTION_O:
2051+ if (1) {
2052+ int opt = atoi(optarg);
2053+ char *sym = "__OPTIMIZE__";
2054+ if (opt)
2055+ tcc_define_symbol(s, sym, 0);
2056+ else
2057+ tcc_undefine_symbol(s, sym);
2058+ }
2059+ break;
20512060 case TCC_OPTION_pedantic:
20522061 case TCC_OPTION_pipe:
20532062 /* ignored */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t