]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Guard translatable strings by -ftranslatable-strings, defaults to ON with -std=fteqcc
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 25 Nov 2012 17:25:01 +0000 (18:25 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 25 Nov 2012 17:25:01 +0000 (18:25 +0100)
main.c
opts.def
parser.c

diff --git a/main.c b/main.c
index 0d9fe04a9f8c043b845c2c1193c78d263f1a56a4..d35e33f83d5c80f27ce47dcd9eedb7ad33df4438 100644 (file)
--- a/main.c
+++ b/main.c
@@ -205,6 +205,7 @@ static bool options_parse(int argc, char **argv) {
                     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);
                     opts_standard = COMPILER_FTEQCC;
                 } else if (!strcmp(argarg, "qccx")) {
index 696ac3774a697e261985d538a7a01b5463ec083a..6fe31e51a82c18d9b72bc716a6fff72437b3a78a 100644 (file)
--- a/opts.def
+++ b/opts.def
@@ -35,6 +35,7 @@
     GMQCC_DEFINE_FLAG(RELAXED_SWITCH)
     GMQCC_DEFINE_FLAG(SHORT_LOGIC)
     GMQCC_DEFINE_FLAG(PERL_LOGIC)
+    GMQCC_DEFINE_FLAG(TRANSLATABLE_STRINGS)
 #endif
 
 /* warning flags */
index 6ccd5e2b3b1458e30d532b73c3ba1774b922450b..5cbdb16d80c508d8021727d3650006b78b85f1e3 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -1304,7 +1304,9 @@ static ast_expression* parse_expression_leave(parser_t *parser, bool stopatcomma
         else
             parser->memberof = 0;
 
-        if (parser->tok == TOKEN_IDENT && !strcmp(parser_tokval(parser), "_")) {
+        if (OPTS_FLAG(TRANSLATABLE_STRINGS) &&
+            parser->tok == TOKEN_IDENT && !strcmp(parser_tokval(parser), "_"))
+        {
             /* a translatable string */
             ast_value *val;