]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
introducing -fassign-function-types, previously guarded by std==qcc this is now the...
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 25 Nov 2012 22:27:48 +0000 (23:27 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 25 Nov 2012 22:27:48 +0000 (23:27 +0100)
main.c
opts.def
parser.c

diff --git a/main.c b/main.c
index 6ee7d8e4611968eb843023d3c6ac8ace965fc64b..9961ac14a89126c3f0c9791b0a832822c518c76c 100644 (file)
--- a/main.c
+++ b/main.c
@@ -202,11 +202,13 @@ static bool options_parse(int argc, char **argv) {
                     opts_standard = COMPILER_GMQCC;
                 } else if (!strcmp(argarg, "qcc")) {
                     options_set(opts_flags, ADJUST_VECTOR_FIELDS, false);
+                    options_set(opts_flags, ASSIGN_FUNCTION_TYPES, true);
                     opts_standard = COMPILER_QCC;
                 } else if (!strcmp(argarg, "fte") || !strcmp(argarg, "fteqcc")) {
                     options_set(opts_flags, FTEPP,                true);
                     options_set(opts_flags, TRANSLATABLE_STRINGS, true);
                     options_set(opts_flags, ADJUST_VECTOR_FIELDS, false);
+                    options_set(opts_flags, ASSIGN_FUNCTION_TYPES, true);
                     opts_standard = COMPILER_FTEQCC;
                 } else if (!strcmp(argarg, "qccx")) {
                     options_set(opts_flags, ADJUST_VECTOR_FIELDS, false);
index 7f4c15e6d15f3f4d8386c523b55a0515ad0da9b7..9779889df06ddf556ad8f8372fd4b5a100f4856e 100644 (file)
--- a/opts.def
+++ b/opts.def
@@ -37,6 +37,7 @@
     GMQCC_DEFINE_FLAG(PERL_LOGIC)
     GMQCC_DEFINE_FLAG(TRANSLATABLE_STRINGS)
     GMQCC_DEFINE_FLAG(INITIALIZED_NONCONSTANTS)
+    GMQCC_DEFINE_FLAG(ASSIGN_FUNCTION_TYPES)
 #endif
 
 /* warning flags */
index fb4f8671f3534cbe658ba13e3bbc8e4e04cb96fc..2af798bb837a4bd496efa605ec8676f136033dc5 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -905,7 +905,7 @@ static bool parser_sy_pop(parser_t *parser, shunt *sy)
                 if (!ast_compare_type(field->expression.next, exprs[1])) {
                     ast_type_to_string(field->expression.next, ty1, sizeof(ty1));
                     ast_type_to_string(exprs[1], ty2, sizeof(ty2));
-                    if (opts_standard == COMPILER_QCC &&
+                    if (OPTS_FLAG(ASSIGN_FUNCTION_TYPES) &&
                         field->expression.next->expression.vtype == TYPE_FUNCTION &&
                         exprs[1]->expression.vtype == TYPE_FUNCTION)
                     {