diff options
| author | maxim nikonov <maxim.nikonov@hqo.co> | 2026-02-06 02:49:13 +0500 |
|---|---|---|
| committer | maxim nikonov <maxim.nikonov@hqo.co> | 2026-02-06 02:49:13 +0500 |
| commit | c19f34db2f4a64326d03cee7edae095051660f65 (patch) | |
| tree | 3c8defa8bcafe90fb907dace5d2a21c2ca5e0f8a /fluid/io/Code_Writer.cxx | |
| parent | 43e0a37906afabb0b3b091b8d3eac9a910cae50c (diff) | |
wip
Diffstat (limited to 'fluid/io/Code_Writer.cxx')
| -rw-r--r-- | fluid/io/Code_Writer.cxx | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/fluid/io/Code_Writer.cxx b/fluid/io/Code_Writer.cxx index 357db80dd..9460a6ac0 100644 --- a/fluid/io/Code_Writer.cxx +++ b/fluid/io/Code_Writer.cxx @@ -782,7 +782,7 @@ int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) { } } } - std::string loc_include, loc_conditional; + const char *loc_include, *loc_conditional; if (proj_.i18n.type==FLD_I18N_TYPE_GNU) { loc_include = proj_.i18n.gnu_include; loc_conditional = proj_.i18n.gnu_conditional; @@ -790,19 +790,19 @@ int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) { loc_include = proj_.i18n.posix_include; loc_conditional = proj_.i18n.posix_conditional; } - if ((proj_.i18n.type != FLD_I18N_TYPE_NONE) && !loc_include.empty()) { - int conditional = !loc_conditional.empty(); + if ((proj_.i18n.type != FLD_I18N_TYPE_NONE) && loc_include && loc_include[0]) { + int conditional = (loc_conditional && loc_conditional[0]); if (conditional) { - write_c("#ifdef %s\n", loc_conditional.c_str()); + write_c("#ifdef %s\n", loc_conditional); indentation++; } if (loc_include[0] != '<' && loc_include[0] != '\"') - write_c("#%sinclude \"%s\"\n", indent(), loc_include.c_str()); + write_c("#%sinclude \"%s\"\n", indent(), loc_include); else - write_c("#%sinclude %s\n", indent(), loc_include.c_str()); + write_c("#%sinclude %s\n", indent(), loc_include); if (proj_.i18n.type == FLD_I18N_TYPE_POSIX) { - if (!proj_.i18n.posix_file.empty()) { - write_c("extern nl_catd %s;\n", proj_.i18n.posix_file.c_str()); + if (proj_.i18n.posix_file && proj_.i18n.posix_file[0]) { + write_c("extern nl_catd %s;\n", proj_.i18n.posix_file); } else { write_c("// Initialize I18N stuff now for menus...\n"); write_c("#%sinclude <locale.h>\n", indent()); @@ -817,9 +817,9 @@ int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) { if (conditional) { write_c("#else\n"); if (proj_.i18n.type == FLD_I18N_TYPE_GNU) { - if (!proj_.i18n.gnu_function.empty()) { - write_c("#%sifndef %s\n", indent(), proj_.i18n.gnu_function.c_str()); - write_c("#%sdefine %s(text) text\n", indent_plus(1), proj_.i18n.gnu_function.c_str()); + if (proj_.i18n.gnu_function && proj_.i18n.gnu_function[0]) { + write_c("#%sifndef %s\n", indent(), proj_.i18n.gnu_function); + write_c("#%sdefine %s(text) text\n", indent_plus(1), proj_.i18n.gnu_function); write_c("#%sendif\n", indent()); } } @@ -831,9 +831,9 @@ int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) { indentation--; write_c("#endif\n"); } - if (proj_.i18n.type == FLD_I18N_TYPE_GNU && proj_.i18n.gnu_static_function[0]) { - write_c("#ifndef %s\n", proj_.i18n.gnu_static_function.c_str()); - write_c("#%sdefine %s(text) text\n", indent_plus(1), proj_.i18n.gnu_static_function.c_str()); + if (proj_.i18n.type == FLD_I18N_TYPE_GNU && proj_.i18n.gnu_static_function && proj_.i18n.gnu_static_function[0]) { + write_c("#ifndef %s\n", proj_.i18n.gnu_static_function); + write_c("#%sdefine %s(text) text\n", indent_plus(1), proj_.i18n.gnu_static_function); write_c("#endif\n"); } } |
