From: Dale Weiler Date: Sun, 1 Dec 2013 15:30:24 +0000 (-0500) Subject: User supplied math constants take precedence X-Git-Tag: xonotic-v0.8.0~40 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b20e2a9d34ce6f062b502631507286e2227e97eb;p=xonotic%2Fgmqcc.git User supplied math constants take precedence --- diff --git a/ftepp.c b/ftepp.c index fc6732e..82495b4 100644 --- a/ftepp.c +++ b/ftepp.c @@ -539,9 +539,11 @@ static bool ftepp_define(ftepp_t *ftepp) macro = ftepp_macro_find(ftepp, ftepp_tokval(ftepp)); - /* ignore creating a math macro if one is already present */ - if (macro && mathconstant) - break; + /* user defined ones take precedence */ + if (macro && mathconstant) { + ftepp_macro_delete(ftepp, ftepp_tokval(ftepp)); + macro = NULL; + } if (macro && ftepp->output_on) { if (ftepp_warn(ftepp, WARN_CPP, "redefining `%s`", ftepp_tokval(ftepp)))