From: Dale Weiler Date: Sun, 1 Dec 2013 15:52:42 +0000 (-0500) Subject: Mask out the math constant precedence stuff unless -fftepp-mathdefs X-Git-Tag: xonotic-v0.8.0~38 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=af53c0cb8331a7aa37dbc8200444915155cb6ad3;p=xonotic%2Fgmqcc.git Mask out the math constant precedence stuff unless -fftepp-mathdefs --- diff --git a/ftepp.c b/ftepp.c index 496a46a..be56446 100644 --- a/ftepp.c +++ b/ftepp.c @@ -530,19 +530,23 @@ static bool ftepp_define(ftepp_t *ftepp) case TOKEN_IDENT: case TOKEN_TYPENAME: case TOKEN_KEYWORD: - for (i = 0; i < GMQCC_ARRAY_COUNT(ftepp_math_constants); i++) { - if (!strcmp(ftepp_math_constants[i][0], ftepp_tokval(ftepp))) { - mathconstant = true; - break; + if (OPTS_FLAG(FTEPP_MATHDEFS)) { + for (i = 0; i < GMQCC_ARRAY_COUNT(ftepp_math_constants); i++) { + if (!strcmp(ftepp_math_constants[i][0], ftepp_tokval(ftepp))) { + mathconstant = true; + break; + } } } macro = ftepp_macro_find(ftepp, ftepp_tokval(ftepp)); - /* user defined ones take precedence */ - if (macro && mathconstant) { - ftepp_macro_delete(ftepp, ftepp_tokval(ftepp)); - macro = NULL; + if (OPTS_FLAG(FTEPP_MATHDEFS)) { + /* user defined ones take precedence */ + if (macro && mathconstant) { + ftepp_macro_delete(ftepp, ftepp_tokval(ftepp)); + macro = NULL; + } } if (macro && ftepp->output_on) {