mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-04-04 08:51:39 +00:00
Guard translatable strings by -ftranslatable-strings, defaults to ON with -std=fteqcc
This commit is contained in:
parent
66317aaef9
commit
2c0a9d78df
3 changed files with 5 additions and 1 deletions
1
main.c
1
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")) {
|
||||
|
|
1
opts.def
1
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 */
|
||||
|
|
4
parser.c
4
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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue