case TOKEN_IDENT:
case TOKEN_TYPENAME:
/* is it a predef? */
- for (i = 0; i < sizeof(ftepp_predefs) / sizeof (*ftepp_predefs); i++) {
- if (!strcmp(ftepp_predefs[i].name, ftepp_tokval(ftepp))) {
- expand = ftepp_predefs[i].func(ftepp->lex);
- ftepp_out(ftepp, expand, false);
- ftepp_next(ftepp); /* skip */
-
- mem_d(expand); /* free memory */
- break;
+ if (OPTS_FLAG(FTEPP_PREDEFS)) {
+ for (i = 0; i < sizeof(ftepp_predefs) / sizeof (*ftepp_predefs); i++) {
+ if (!strcmp(ftepp_predefs[i].name, ftepp_tokval(ftepp))) {
+ expand = ftepp_predefs[i].func(ftepp->lex);
+ ftepp_out(ftepp, expand, false);
+ ftepp_next(ftepp); /* skip */
+
+ mem_d(expand); /* free memory */
+ break;
+ }
}
}
case 'E':
opts.pp_only = true;
+ opts_set(opts.flags, FTEPP_PREDEFS, true); /* predefs on for -E */
break;
/* debug turns on -flno */
/* flags */
opts_set(opts.flags, ADJUST_VECTOR_FIELDS, true);
opts_set(opts.flags, FTEPP, false);
+ opts_set(opts.flags, FTEPP_PREDEFS, false);
opts_set(opts.flags, CORRECT_TERNARY, true);
}
GMQCC_DEFINE_FLAG(DARKPLACES_STRING_TABLE_BUG)
GMQCC_DEFINE_FLAG(ADJUST_VECTOR_FIELDS)
GMQCC_DEFINE_FLAG(FTEPP)
+ GMQCC_DEFINE_FLAG(FTEPP_PREDEFS)
GMQCC_DEFINE_FLAG(RELAXED_SWITCH)
GMQCC_DEFINE_FLAG(SHORT_LOGIC)
GMQCC_DEFINE_FLAG(PERL_LOGIC)
#endif
#ifdef GMQCC_TYPE_OPTIMIZATIONS
- GMQCC_DEFINE_FLAG(PEEPHOLE, 1)
- GMQCC_DEFINE_FLAG(LOCAL_TEMPS, 3)
- GMQCC_DEFINE_FLAG(TAIL_RECURSION, 1)
- GMQCC_DEFINE_FLAG(TAIL_CALLS, 2)
- GMQCC_DEFINE_FLAG(OVERLAP_LOCALS, 3)
+ GMQCC_DEFINE_FLAG(PEEPHOLE, 1)
+ GMQCC_DEFINE_FLAG(LOCAL_TEMPS, 3)
+ GMQCC_DEFINE_FLAG(TAIL_RECURSION, 1)
+ GMQCC_DEFINE_FLAG(TAIL_CALLS, 2)
+ GMQCC_DEFINE_FLAG(OVERLAP_LOCALS, 3)
GMQCC_DEFINE_FLAG(STRIP_CONSTANT_NAMES, 1)
#endif