]> de.git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Relax the preprocessor condition: # in the middle of a line also counts, but take...
authorWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 16 Nov 2012 20:37:34 +0000 (21:37 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 16 Nov 2012 20:37:34 +0000 (21:37 +0100)
ftepp.c

diff --git a/ftepp.c b/ftepp.c
index fe3b783453762ec73b8f988f5c99d834f864d96b..1ac8a4c216b4210601e6e11175233cc63d345c75 100644 (file)
--- a/ftepp.c
+++ b/ftepp.c
@@ -359,6 +359,11 @@ on_error:
     return false;
 }
 
+static bool ftepp_macro_expand(ftepp_t *ftepp, ppmacro *macro, macroparam *params)
+{
+    return true;
+}
+
 static bool ftepp_macro_call(ftepp_t *ftepp, ppmacro *macro)
 {
     size_t     o;
@@ -394,9 +399,8 @@ static bool ftepp_macro_call(ftepp_t *ftepp, ppmacro *macro)
         goto cleanup;
     }
 
-
-    ftepp_out(ftepp, "Parsed macro parameters", false);
-    goto cleanup;
+    if (!ftepp_macro_expand(ftepp, macro, params))
+        retval = false;
 
 cleanup:
     for (o = 0; o < vec_size(params); ++o)
@@ -719,6 +723,12 @@ static bool ftepp_hash(ftepp_t *ftepp)
         case TOKEN_EOF:
             ftepp_error(ftepp, "missing newline at end of file", ftepp_tokval(ftepp));
             return false;
+
+        /* Builtins! Don't forget the builtins! */
+        case TOKEN_INTCONST:
+        case TOKEN_FLOATCONST:
+            ftepp_out(ftepp, "#", false);
+            return true;
     }
     if (!ftepp_skipspace(ftepp))
         return false;
@@ -739,9 +749,13 @@ static bool ftepp_preprocess(ftepp_t *ftepp)
     {
         if (ftepp->token >= TOKEN_EOF)
             break;
-
+#if 0
         ftepp->newline = newline;
         newline = false;
+#else
+        /* For the sake of FTE compatibility... FU, really */
+        ftepp->newline = newline = true;
+#endif
 
         switch (ftepp->token) {
             case TOKEN_KEYWORD: