Guard translatable strings by -ftranslatable-strings, defaults to ON with -std=fteqcc

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-11-25 18:25:01 +01:00
parent 66317aaef9
commit 2c0a9d78df
3 changed files with 5 additions and 1 deletions

1
main.c
View file

@ -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")) {

View file

@ -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 */

View file

@ -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;