summaryrefslogtreecommitdiff
path: root/src/string.cpp
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2018-05-26 22:51:02 +0200
committerMichael Lutz <michi@icosahedron.de>2018-06-06 21:37:09 +0200
commiteec3f40931d7a7dc5a82691ee126f3f0ea0ae6a9 (patch)
tree4fafedae2025ad816c98326156694bff7e6308fd /src/string.cpp
parent33829dc6abb61dc1a5c0d4807aad433cfcb45642 (diff)
downloadopenttd-eec3f40931d7a7dc5a82691ee126f3f0ea0ae6a9.tar.xz
Change: [Win32] Use Uniscribe instead of ICU for text caret handling.
This removes the need for the ICU lib on Windows.
Diffstat (limited to 'src/string.cpp')
-rw-r--r--src/string.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/string.cpp b/src/string.cpp
index 170334792..4c714a2e0 100644
--- a/src/string.cpp
+++ b/src/string.cpp
@@ -29,6 +29,10 @@
#include "os/windows/win32.h"
#endif
+#ifdef WITH_UNISCRIBE
+#include "os/windows/string_uniscribe.h"
+#endif
+
#ifdef WITH_ICU_SORT
/* Required by strnatcmp. */
#include <unicode/ustring.h>
@@ -594,7 +598,14 @@ int strnatcmp(const char *s1, const char *s2, bool ignore_garbage_at_front)
return strcasecmp(s1, s2);
}
-#ifdef WITH_ICU_SORT
+#ifdef WITH_UNISCRIBE
+
+/* static */ StringIterator *StringIterator::Create()
+{
+ return new UniscribeStringIterator();
+}
+
+#elif defined(WITH_ICU_SORT)
#include <unicode/utext.h>
#include <unicode/brkiter.h>