From: Wolfgang (Blub) Bumiller Date: Sun, 25 Nov 2012 17:25:01 +0000 (+0100) Subject: Guard translatable strings by -ftranslatable-strings, defaults to ON with -std=fteqcc X-Git-Tag: 0.1.9~254 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2c0a9d78df46286eb566a1e0fa06e4cfc7605ad2;p=xonotic%2Fgmqcc.git Guard translatable strings by -ftranslatable-strings, defaults to ON with -std=fteqcc --- diff --git a/main.c b/main.c index 0d9fe04..d35e33f 100644 --- 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")) { diff --git a/opts.def b/opts.def index 696ac37..6fe31e5 100644 --- 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 */ diff --git a/parser.c b/parser.c index 6ccd5e2..5cbdb16 100644 --- 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;