mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 14:27:16 +00:00
Codechange: ICU_SORT is in reality ICU_I18N (according to their CMake files)
By naming it in a different way, things get a bit confusing. Especially if we are switching to CMake, which autodetects these things, we need to use the name the authors of ICU gave it; not our interpertation of that name.
This commit is contained in:
parent
52d7e7d45e
commit
36105841b9
2
Doxyfile
2
Doxyfile
@ -297,7 +297,7 @@ PREDEFINED = ENABLE_NETWORK \
|
|||||||
WITH_PNG \
|
WITH_PNG \
|
||||||
WITH_FONTCONFIG \
|
WITH_FONTCONFIG \
|
||||||
WITH_FREETYPE \
|
WITH_FREETYPE \
|
||||||
WITH_ICU_SORT \
|
WITH_ICU_I18N \
|
||||||
WITH_ICU_LX \
|
WITH_ICU_LX \
|
||||||
UNICODE \
|
UNICODE \
|
||||||
_UNICODE \
|
_UNICODE \
|
||||||
|
@ -1776,7 +1776,7 @@ make_cflags_and_ldflags() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$icu_sort_config" ]; then
|
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' ' '`"
|
CFLAGS="$CFLAGS `$icu_sort_config --cflags | tr '\n\r' ' '`"
|
||||||
|
|
||||||
if [ "$static_icu" != "0" ]; then
|
if [ "$static_icu" != "0" ]; then
|
||||||
|
@ -52,9 +52,9 @@
|
|||||||
# include <ft2build.h>
|
# include <ft2build.h>
|
||||||
# include FT_FREETYPE_H
|
# include FT_FREETYPE_H
|
||||||
#endif /* WITH_FREETYPE */
|
#endif /* WITH_FREETYPE */
|
||||||
#if defined(WITH_ICU_LX) || defined(WITH_ICU_SORT)
|
#if defined(WITH_ICU_LX) || defined(WITH_ICU_I18N)
|
||||||
# include <unicode/uversion.h>
|
# include <unicode/uversion.h>
|
||||||
#endif /* WITH_ICU_LX || WITH_ICU_SORT */
|
#endif /* WITH_ICU_LX || WITH_ICU_I18N */
|
||||||
#ifdef WITH_LIBLZMA
|
#ifdef WITH_LIBLZMA
|
||||||
# include <lzma.h>
|
# include <lzma.h>
|
||||||
#endif
|
#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);
|
buffer += seprintf(buffer, last, " FreeType: %d.%d.%d\n", major, minor, patch);
|
||||||
#endif /* WITH_FREETYPE */
|
#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' */
|
/* 4 times 0-255, separated by dots (.) and a trailing '\0' */
|
||||||
char buf[4 * 3 + 3 + 1];
|
char buf[4 * 3 + 3 + 1];
|
||||||
UVersionInfo ver;
|
UVersionInfo ver;
|
||||||
u_getVersion(ver);
|
u_getVersion(ver);
|
||||||
u_versionToString(ver, buf);
|
u_versionToString(ver, buf);
|
||||||
#ifdef WITH_ICU_SORT
|
#ifdef WITH_ICU_I18N
|
||||||
buffer += seprintf(buffer, last, " ICU i18n: %s\n", buf);
|
buffer += seprintf(buffer, last, " ICU i18n: %s\n", buf);
|
||||||
#endif
|
#endif
|
||||||
#ifdef WITH_ICU_LX
|
#ifdef WITH_ICU_LX
|
||||||
buffer += seprintf(buffer, last, " ICU lx: %s\n", buf);
|
buffer += seprintf(buffer, last, " ICU lx: %s\n", buf);
|
||||||
#endif
|
#endif
|
||||||
#endif /* WITH_ICU_LX || WITH_ICU_SORT */
|
#endif /* WITH_ICU_LX || WITH_ICU_I18N */
|
||||||
|
|
||||||
#ifdef WITH_LIBLZMA
|
#ifdef WITH_LIBLZMA
|
||||||
buffer += seprintf(buffer, last, " LZMA: %s\n", lzma_version_string());
|
buffer += seprintf(buffer, last, " LZMA: %s\n", lzma_version_string());
|
||||||
|
@ -13,9 +13,9 @@
|
|||||||
#define LANGUAGE_H
|
#define LANGUAGE_H
|
||||||
|
|
||||||
#include "core/smallvec_type.hpp"
|
#include "core/smallvec_type.hpp"
|
||||||
#ifdef WITH_ICU_SORT
|
#ifdef WITH_ICU_I18N
|
||||||
#include <unicode/coll.h>
|
#include <unicode/coll.h>
|
||||||
#endif /* WITH_ICU_SORT */
|
#endif /* WITH_ICU_I18N */
|
||||||
#include "strings_type.h"
|
#include "strings_type.h"
|
||||||
|
|
||||||
static const uint8 CASE_GENDER_LEN = 16; ///< The (maximum) length of a case/gender string.
|
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. */
|
/** The currently loaded language. */
|
||||||
extern const LanguageMetadata *_current_language;
|
extern const LanguageMetadata *_current_language;
|
||||||
|
|
||||||
#ifdef WITH_ICU_SORT
|
#ifdef WITH_ICU_I18N
|
||||||
extern icu::Collator *_current_collator;
|
extern icu::Collator *_current_collator;
|
||||||
#endif /* WITH_ICU_SORT */
|
#endif /* WITH_ICU_I18N */
|
||||||
|
|
||||||
bool ReadLanguagePack(const LanguageMetadata *lang);
|
bool ReadLanguagePack(const LanguageMetadata *lang);
|
||||||
const LanguageMetadata *GetLanguage(byte newgrflangid);
|
const LanguageMetadata *GetLanguage(byte newgrflangid);
|
||||||
|
@ -37,12 +37,12 @@
|
|||||||
#include "os/macosx/string_osx.h"
|
#include "os/macosx/string_osx.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WITH_ICU_SORT
|
#ifdef WITH_ICU_I18N
|
||||||
/* Required by strnatcmp. */
|
/* Required by strnatcmp. */
|
||||||
#include <unicode/ustring.h>
|
#include <unicode/ustring.h>
|
||||||
#include "language.h"
|
#include "language.h"
|
||||||
#include "gfx_func.h"
|
#include "gfx_func.h"
|
||||||
#endif /* WITH_ICU_SORT */
|
#endif /* WITH_ICU_I18N */
|
||||||
|
|
||||||
/* The function vsnprintf is used internally to perform the required formatting
|
/* 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. */
|
* 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);
|
s2 = SkipGarbage(s2);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_ICU_SORT
|
#ifdef WITH_ICU_I18N
|
||||||
if (_current_collator != NULL) {
|
if (_current_collator != NULL) {
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
int result = _current_collator->compareUTF8(s1, s2, status);
|
int result = _current_collator->compareUTF8(s1, s2, status);
|
||||||
if (U_SUCCESS(status)) return result;
|
if (U_SUCCESS(status)) return result;
|
||||||
}
|
}
|
||||||
#endif /* WITH_ICU_SORT */
|
#endif /* WITH_ICU_I18N */
|
||||||
|
|
||||||
#if defined(_WIN32) && !defined(STRGEN) && !defined(SETTINGSGEN)
|
#if defined(_WIN32) && !defined(STRGEN) && !defined(SETTINGSGEN)
|
||||||
int res = OTTDStringCompare(s1, s2);
|
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();
|
return new UniscribeStringIterator();
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(WITH_ICU_SORT)
|
#elif defined(WITH_ICU_I18N)
|
||||||
|
|
||||||
#include <unicode/utext.h>
|
#include <unicode/utext.h>
|
||||||
#include <unicode/brkiter.h>
|
#include <unicode/brkiter.h>
|
||||||
|
@ -51,9 +51,9 @@ const LanguageMetadata *_current_language = NULL; ///< The currently loaded lang
|
|||||||
|
|
||||||
TextDirection _current_text_dir; ///< Text direction of the currently selected language.
|
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.
|
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 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
|
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);
|
MacOSSetCurrentLocaleName(_current_language->isocode);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WITH_ICU_SORT
|
#ifdef WITH_ICU_I18N
|
||||||
/* Delete previous collator. */
|
/* Delete previous collator. */
|
||||||
if (_current_collator != NULL) {
|
if (_current_collator != NULL) {
|
||||||
delete _current_collator;
|
delete _current_collator;
|
||||||
@ -1813,7 +1813,7 @@ bool ReadLanguagePack(const LanguageMetadata *lang)
|
|||||||
delete _current_collator;
|
delete _current_collator;
|
||||||
_current_collator = NULL;
|
_current_collator = NULL;
|
||||||
}
|
}
|
||||||
#endif /* WITH_ICU_SORT */
|
#endif /* WITH_ICU_I18N */
|
||||||
|
|
||||||
/* Some lists need to be sorted again after a language change. */
|
/* Some lists need to be sorted again after a language change. */
|
||||||
ReconsiderGameScriptLanguage();
|
ReconsiderGameScriptLanguage();
|
||||||
|
Loading…
Reference in New Issue
Block a user