]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Mask out the math constant precedence stuff unless -fftepp-mathdefs
authorDale Weiler <killfieldengine@gmail.com>
Sun, 1 Dec 2013 15:52:42 +0000 (10:52 -0500)
committerDale Weiler <killfieldengine@gmail.com>
Sun, 1 Dec 2013 15:52:42 +0000 (10:52 -0500)
ftepp.c

diff --git a/ftepp.c b/ftepp.c
index 496a46a337e5571ffacd95655183a638bfa92994..be5644627b58444f0385ee09c021d8c78661e30d 100644 (file)
--- 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) {