]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
User supplied math constants take precedence
authorDale Weiler <killfieldengine@gmail.com>
Sun, 1 Dec 2013 15:30:24 +0000 (10:30 -0500)
committerDale Weiler <killfieldengine@gmail.com>
Sun, 1 Dec 2013 15:30:24 +0000 (10:30 -0500)
ftepp.c

diff --git a/ftepp.c b/ftepp.c
index fc6732e5647d9548f0e4199ec5a9de1aef4b1739..82495b44e3c2353ebe101af7b43dd84359882c2e 100644 (file)
--- 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)))