summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2019-03-10 16:43:59 +0100
committerPatric Stout <truebrain@openttd.org>2019-03-11 10:16:00 +0100
commit52d7e7d45e0a2a6033942602ed9fdec821a7d2af (patch)
tree4db1138219b406c775dfad6e85432209ce004b92
parent7adae09897c6f17a60de9468e9e11d166ff52278 (diff)
downloadopenttd-52d7e7d45e0a2a6033942602ed9fdec821a7d2af.tar.xz
Codechange: ICU_LAYOUT is in reality ICU_LX (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/gfx_layout.cpp12
-rw-r--r--src/gfx_layout.h10
-rw-r--r--src/strings.cpp4
6 files changed, 20 insertions, 20 deletions
diff --git a/Doxyfile b/Doxyfile
index 54e4197c6..93d1e968f 100644
--- a/Doxyfile
+++ b/Doxyfile
@@ -298,7 +298,7 @@ PREDEFINED = ENABLE_NETWORK \
WITH_FONTCONFIG \
WITH_FREETYPE \
WITH_ICU_SORT \
- WITH_ICU_LAYOUT \
+ WITH_ICU_LX \
UNICODE \
_UNICODE \
_GNU_SOURCE \
diff --git a/config.lib b/config.lib
index cb006f47d..5eb32477f 100644
--- a/config.lib
+++ b/config.lib
@@ -1765,7 +1765,7 @@ make_cflags_and_ldflags() {
fi
if [ -n "$icu_layout_config" ]; then
- CFLAGS="$CFLAGS -DWITH_ICU_LAYOUT"
+ CFLAGS="$CFLAGS -DWITH_ICU_LX"
CFLAGS="$CFLAGS `$icu_layout_config --cflags | tr '\n\r' ' '`"
if [ "$static_icu" != "0" ]; then
diff --git a/src/crashlog.cpp b/src/crashlog.cpp
index 8fbc4d3ce..bf522d96c 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_LAYOUT) || defined(WITH_ICU_SORT)
+#if defined(WITH_ICU_LX) || defined(WITH_ICU_SORT)
# include <unicode/uversion.h>
-#endif /* WITH_ICU_SORT || WITH_ICU_LAYOUT */
+#endif /* WITH_ICU_LX || WITH_ICU_SORT */
#ifdef WITH_LIBLZMA
# include <lzma.h>
#endif
@@ -240,7 +240,7 @@ 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_LAYOUT) || defined(WITH_ICU_SORT)
+#if defined(WITH_ICU_LX) || defined(WITH_ICU_SORT)
/* 4 times 0-255, separated by dots (.) and a trailing '\0' */
char buf[4 * 3 + 3 + 1];
UVersionInfo ver;
@@ -249,10 +249,10 @@ char *CrashLog::LogLibraries(char *buffer, const char *last) const
#ifdef WITH_ICU_SORT
buffer += seprintf(buffer, last, " ICU i18n: %s\n", buf);
#endif
-#ifdef WITH_ICU_LAYOUT
+#ifdef WITH_ICU_LX
buffer += seprintf(buffer, last, " ICU lx: %s\n", buf);
#endif
-#endif /* WITH_ICU_SORT || WITH_ICU_LAYOUT */
+#endif /* WITH_ICU_LX || WITH_ICU_SORT */
#ifdef WITH_LIBLZMA
buffer += seprintf(buffer, last, " LZMA: %s\n", lzma_version_string());
diff --git a/src/gfx_layout.cpp b/src/gfx_layout.cpp
index c65ead90e..3bf490da6 100644
--- a/src/gfx_layout.cpp
+++ b/src/gfx_layout.cpp
@@ -17,9 +17,9 @@
#include "table/control_codes.h"
-#ifdef WITH_ICU_LAYOUT
+#ifdef WITH_ICU_LX
#include <unicode/ustring.h>
-#endif /* WITH_ICU_LAYOUT */
+#endif /* WITH_ICU_LX */
#ifdef WITH_UNISCRIBE
#include "os/windows/string_uniscribe.h"
@@ -50,7 +50,7 @@ Font::Font(FontSize size, TextColour colour) :
assert(size < FS_END);
}
-#ifdef WITH_ICU_LAYOUT
+#ifdef WITH_ICU_LX
/* Implementation details of LEFontInstance */
le_int32 Font::getUnitsPerEM() const
@@ -226,7 +226,7 @@ public:
return length;
}
};
-#endif /* WITH_ICU_LAYOUT */
+#endif /* WITH_ICU_LX */
/*** Paragraph layout ***/
/**
@@ -674,11 +674,11 @@ Layouter::Layouter(const char *str, int maxw, TextColour colour, FontSize fontsi
} else {
/* Line is new, layout it */
FontState old_state = state;
-#if defined(WITH_ICU_LAYOUT) || defined(WITH_UNISCRIBE) || defined(WITH_COCOA)
+#if defined(WITH_ICU_LX) || defined(WITH_UNISCRIBE) || defined(WITH_COCOA)
const char *old_str = str;
#endif
-#ifdef WITH_ICU_LAYOUT
+#ifdef WITH_ICU_LX
GetLayouter<ICUParagraphLayoutFactory>(line, str, state);
if (line.layout == NULL) {
static bool warned = false;
diff --git a/src/gfx_layout.h b/src/gfx_layout.h
index 94cbac073..6f611d6e6 100644
--- a/src/gfx_layout.h
+++ b/src/gfx_layout.h
@@ -21,12 +21,12 @@
#include <stack>
#include <vector>
-#ifdef WITH_ICU_LAYOUT
+#ifdef WITH_ICU_LX
#include "layout/ParagraphLayout.h"
#define ICU_FONTINSTANCE : public icu::LEFontInstance
-#else /* WITH_ICU_LAYOUT */
+#else /* WITH_ICU_LX */
#define ICU_FONTINSTANCE
-#endif /* WITH_ICU_LAYOUT */
+#endif /* WITH_ICU_LX */
/**
* Text drawing parameters, which can change while drawing a line, but are kept between multiple parts
@@ -89,7 +89,7 @@ public:
Font(FontSize size, TextColour colour);
-#ifdef WITH_ICU_LAYOUT
+#ifdef WITH_ICU_LX
/* Implementation details of LEFontInstance */
le_int32 getUnitsPerEM() const;
@@ -105,7 +105,7 @@ public:
LEGlyphID mapCharToGlyph(LEUnicode32 ch) const;
void getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const;
le_bool getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const;
-#endif /* WITH_ICU_LAYOUT */
+#endif /* WITH_ICU_LX */
};
/** Mapping from index to font. */
diff --git a/src/strings.cpp b/src/strings.cpp
index a3ece9830..849a540f2 100644
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -2138,7 +2138,7 @@ void CheckForMissingGlyphs(bool base_font, MissingGlyphSearcher *searcher)
/* Update the font with cache */
LoadStringWidthTable(searcher->Monospace());
-#if !defined(WITH_ICU_LAYOUT) && !defined(WITH_UNISCRIBE) && !defined(WITH_COCOA)
+#if !defined(WITH_ICU_LX) && !defined(WITH_UNISCRIBE) && !defined(WITH_COCOA)
/*
* For right-to-left languages we need the ICU library. If
* we do not have support for that library we warn the user
@@ -2158,5 +2158,5 @@ void CheckForMissingGlyphs(bool base_font, MissingGlyphSearcher *searcher)
SetDParamStr(0, err_str);
ShowErrorMessage(STR_JUST_RAW_STRING, INVALID_STRING_ID, WL_ERROR);
}
-#endif /* !WITH_ICU_LAYOUT */
+#endif /* !WITH_ICU_LX */
}