summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2019-03-10 16:46:19 +0100
committerPatric Stout <truebrain@openttd.org>2019-03-11 10:16:00 +0100
commit36105841b9d09a3c1cd1a8f7a5bd7b84af135d9f (patch)
tree55f8b48637df8c4b15d6a6f569f2b71b71f86106
parent52d7e7d45e0a2a6033942602ed9fdec821a7d2af (diff)
downloadopenttd-36105841b9d09a3c1cd1a8f7a5bd7b84af135d9f.tar.xz
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.
-rw-r--r--Doxyfile2
-rw-r--r--config.lib2
-rw-r--r--src/crashlog.cpp10
-rw-r--r--src/language.h8
-rw-r--r--src/string.cpp10
-rw-r--r--src/strings.cpp8
6 files changed, 20 insertions, 20 deletions
diff --git a/Doxyfile b/Doxyfile
index 93d1e968f..b6b46257a 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 5eb32477f..bab1ca4ea 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 bf522d96c..ddb0c09cc 100644
--- a/src/crashlog.cpp
+++ b/src/crashlog.cpp
@@ -52,9 +52,9 @@
# include <ft2build.h>
# 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 <unicode/uversion.h>
-#endif /* WITH_ICU_LX || WITH_ICU_SORT */
+#endif /* WITH_ICU_LX || WITH_ICU_I18N */
#ifdef WITH_LIBLZMA
# include <lzma.h>
#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 ec241dbd8..8df59f74f 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 <unicode/coll.h>
-#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 ae1b556af..18ed863d0 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 <unicode/ustring.h>
#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 <unicode/utext.h>
#include <unicode/brkiter.h>
diff --git a/src/strings.cpp b/src/strings.cpp
index 849a540f2..b5fb36d4d 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();