mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-29 05:51:16 +00:00
Mask out the math constant precedence stuff unless -fftepp-mathdefs
This commit is contained in:
parent
6a44b72db3
commit
af53c0cb83
1 changed files with 12 additions and 8 deletions
20
ftepp.c
20
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) {
|
||||
|
|
Loading…
Reference in a new issue