diff --git a/Doxyfile b/Doxyfile index 93d1e968f6..b6b46257a7 100644 --- a/Doxyfile +++ b/Doxyfile @@ -297,7 +297,7 @@ PREDEFINED = ENABLE_NETWORK \ WITH_PNG \ WITH_FONTCONFIG \ WITH_FREETYPE \ - WITH_ICU_SORT \ + WITH_ICU_I18N \ WITH_ICU_LX \ UNICODE \ _UNICODE \ diff --git a/config.lib b/config.lib index 5eb32477f4..bab1ca4ea4 100644 --- a/config.lib +++ b/config.lib @@ -1776,7 +1776,7 @@ make_cflags_and_ldflags() { fi if [ -n "$icu_sort_config" ]; then - CFLAGS="$CFLAGS -DWITH_ICU_SORT" + CFLAGS="$CFLAGS -DWITH_ICU_I18N" CFLAGS="$CFLAGS `$icu_sort_config --cflags | tr '\n\r' ' '`" if [ "$static_icu" != "0" ]; then diff --git a/src/crashlog.cpp b/src/crashlog.cpp index bf522d96c7..ddb0c09cc6 100644 --- a/src/crashlog.cpp +++ b/src/crashlog.cpp @@ -52,9 +52,9 @@ # include # include FT_FREETYPE_H #endif /* WITH_FREETYPE */ -#if defined(WITH_ICU_LX) || defined(WITH_ICU_SORT) +#if defined(WITH_ICU_LX) || defined(WITH_ICU_I18N) # include -#endif /* WITH_ICU_LX || WITH_ICU_SORT */ +#endif /* WITH_ICU_LX || WITH_ICU_I18N */ #ifdef WITH_LIBLZMA # include #endif @@ -240,19 +240,19 @@ char *CrashLog::LogLibraries(char *buffer, const char *last) const buffer += seprintf(buffer, last, " FreeType: %d.%d.%d\n", major, minor, patch); #endif /* WITH_FREETYPE */ -#if defined(WITH_ICU_LX) || defined(WITH_ICU_SORT) +#if defined(WITH_ICU_LX) || defined(WITH_ICU_I18N) /* 4 times 0-255, separated by dots (.) and a trailing '\0' */ char buf[4 * 3 + 3 + 1]; UVersionInfo ver; u_getVersion(ver); u_versionToString(ver, buf); -#ifdef WITH_ICU_SORT +#ifdef WITH_ICU_I18N buffer += seprintf(buffer, last, " ICU i18n: %s\n", buf); #endif #ifdef WITH_ICU_LX buffer += seprintf(buffer, last, " ICU lx: %s\n", buf); #endif -#endif /* WITH_ICU_LX || WITH_ICU_SORT */ +#endif /* WITH_ICU_LX || WITH_ICU_I18N */ #ifdef WITH_LIBLZMA buffer += seprintf(buffer, last, " LZMA: %s\n", lzma_version_string()); diff --git a/src/language.h b/src/language.h index ec241dbd8c..8df59f74ff 100644 --- a/src/language.h +++ b/src/language.h @@ -13,9 +13,9 @@ #define LANGUAGE_H #include "core/smallvec_type.hpp" -#ifdef WITH_ICU_SORT +#ifdef WITH_ICU_I18N #include -#endif /* WITH_ICU_SORT */ +#endif /* WITH_ICU_I18N */ #include "strings_type.h" static const uint8 CASE_GENDER_LEN = 16; ///< The (maximum) length of a case/gender string. @@ -104,9 +104,9 @@ extern LanguageList _languages; /** The currently loaded language. */ extern const LanguageMetadata *_current_language; -#ifdef WITH_ICU_SORT +#ifdef WITH_ICU_I18N extern icu::Collator *_current_collator; -#endif /* WITH_ICU_SORT */ +#endif /* WITH_ICU_I18N */ bool ReadLanguagePack(const LanguageMetadata *lang); const LanguageMetadata *GetLanguage(byte newgrflangid); diff --git a/src/string.cpp b/src/string.cpp index ae1b556aff..18ed863d0e 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -37,12 +37,12 @@ #include "os/macosx/string_osx.h" #endif -#ifdef WITH_ICU_SORT +#ifdef WITH_ICU_I18N /* Required by strnatcmp. */ #include #include "language.h" #include "gfx_func.h" -#endif /* WITH_ICU_SORT */ +#endif /* WITH_ICU_I18N */ /* The function vsnprintf is used internally to perform the required formatting * tasks. As such this one must be allowed, and makes sure it's terminated. */ @@ -584,13 +584,13 @@ int strnatcmp(const char *s1, const char *s2, bool ignore_garbage_at_front) s2 = SkipGarbage(s2); } -#ifdef WITH_ICU_SORT +#ifdef WITH_ICU_I18N if (_current_collator != NULL) { UErrorCode status = U_ZERO_ERROR; int result = _current_collator->compareUTF8(s1, s2, status); if (U_SUCCESS(status)) return result; } -#endif /* WITH_ICU_SORT */ +#endif /* WITH_ICU_I18N */ #if defined(_WIN32) && !defined(STRGEN) && !defined(SETTINGSGEN) int res = OTTDStringCompare(s1, s2); @@ -613,7 +613,7 @@ int strnatcmp(const char *s1, const char *s2, bool ignore_garbage_at_front) return new UniscribeStringIterator(); } -#elif defined(WITH_ICU_SORT) +#elif defined(WITH_ICU_I18N) #include #include diff --git a/src/strings.cpp b/src/strings.cpp index 849a540f2c..b5fb36d4d9 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -51,9 +51,9 @@ const LanguageMetadata *_current_language = NULL; ///< The currently loaded lang TextDirection _current_text_dir; ///< Text direction of the currently selected language. -#ifdef WITH_ICU_SORT +#ifdef WITH_ICU_I18N icu::Collator *_current_collator = NULL; ///< Collator for the language currently in use. -#endif /* WITH_ICU_SORT */ +#endif /* WITH_ICU_I18N */ static uint64 _global_string_params_data[20]; ///< Global array of string parameters. To access, use #SetDParam. static WChar _global_string_params_type[20]; ///< Type of parameters stored in #_global_string_params @@ -1796,7 +1796,7 @@ bool ReadLanguagePack(const LanguageMetadata *lang) MacOSSetCurrentLocaleName(_current_language->isocode); #endif -#ifdef WITH_ICU_SORT +#ifdef WITH_ICU_I18N /* Delete previous collator. */ if (_current_collator != NULL) { delete _current_collator; @@ -1813,7 +1813,7 @@ bool ReadLanguagePack(const LanguageMetadata *lang) delete _current_collator; _current_collator = NULL; } -#endif /* WITH_ICU_SORT */ +#endif /* WITH_ICU_I18N */ /* Some lists need to be sorted again after a language change. */ ReconsiderGameScriptLanguage();