From 4b16a8bf8434a9067121d47bf8e92b76ed57adc9 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 2 Aug 2018 21:01:12 +0200 Subject: [PATCH] lib/icu: require at least version 50 --- configure.ac | 2 +- src/lib/icu/Collate.cxx | 15 --------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index 014f582ba..abc8f36ba 100644 --- a/configure.ac +++ b/configure.ac @@ -467,7 +467,7 @@ AC_ARG_ENABLE(icu, [enable libicu for Unicode (default: auto)]),, enable_icu=auto) -MPD_AUTO_PKG(icu, ICU, [icu-i18n], [libicu], [libicu not found]) +MPD_AUTO_PKG(icu, ICU, [icu-i18n >= 50], [libicu], [libicu not found]) MPD_DEFINE_CONDITIONAL(enable_icu, HAVE_ICU, [libicu]) AC_ARG_ENABLE(iconv, diff --git a/src/lib/icu/Collate.cxx b/src/lib/icu/Collate.cxx index aaff50acf..cf19a4105 100644 --- a/src/lib/icu/Collate.cxx +++ b/src/lib/icu/Collate.cxx @@ -85,23 +85,8 @@ IcuCollate(const char *a, const char *b) noexcept #ifdef HAVE_ICU assert(collator != nullptr); -#if U_ICU_VERSION_MAJOR_NUM >= 50 UErrorCode code = U_ZERO_ERROR; return (int)ucol_strcollUTF8(collator, a, -1, b, -1, &code); -#else - /* fall back to ucol_strcoll() */ - - try { - const auto au = UCharFromUTF8(a); - const auto bu = UCharFromUTF8(b); - - return ucol_strcoll(collator, au.begin(), au.size(), - bu.begin(), bu.size()); - } catch (...) { - /* fall back to plain strcasecmp() */ - return strcasecmp(a, b); - } -#endif #elif defined(_WIN32) AllocatedString wa = nullptr, wb = nullptr;