From: Markus Scherer Date: Wed, 8 Mar 2017 05:59:25 +0000 (+0000) Subject: ICU-12992 make the old normlzr.h work with configured UChar=uint16_t, and do not... X-Git-Tag: release-59-rc~119^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a8bc4d76826c0f9221180a7095a1c219fca32871;p=icu ICU-12992 make the old normlzr.h work with configured UChar=uint16_t, and do not include it from coll.h any more (it only needs unorm.h) X-SVN-Rev: 39744 --- diff --git a/icu4c/source/common/unicode/normlzr.h b/icu4c/source/common/unicode/normlzr.h index 31af07b7cc1..02ef13f2fd3 100644 --- a/icu4c/source/common/unicode/normlzr.h +++ b/icu4c/source/common/unicode/normlzr.h @@ -795,9 +795,15 @@ inline int32_t Normalizer::compare(const UnicodeString &s1, const UnicodeString &s2, uint32_t options, UErrorCode &errorCode) { + const char16_t *p1 = s1.getBuffer(); + const char16_t *p2 = s2.getBuffer(); +#ifdef U_ALIASING_BARRIER + U_ALIASING_BARRIER(p1); + U_ALIASING_BARRIER(p2); +#endif // all argument checking is done in unorm_compare - return unorm_compare(s1.getBuffer(), s1.length(), - s2.getBuffer(), s2.length(), + return unorm_compare(reinterpret_cast(p1), s1.length(), + reinterpret_cast(p2), s2.length(), options, &errorCode); } diff --git a/icu4c/source/i18n/coleitr.cpp b/icu4c/source/i18n/coleitr.cpp index 5668097a8ce..64d3ab4d2bf 100644 --- a/icu4c/source/i18n/coleitr.cpp +++ b/icu4c/source/i18n/coleitr.cpp @@ -29,6 +29,7 @@ #if !UCONFIG_NO_COLLATION +#include "unicode/chariter.h" #include "unicode/coleitr.h" #include "unicode/tblcoll.h" #include "unicode/ustring.h" diff --git a/icu4c/source/i18n/unicode/coll.h b/icu4c/source/i18n/unicode/coll.h index a53df5deebd..7e467df80e0 100644 --- a/icu4c/source/i18n/unicode/coll.h +++ b/icu4c/source/i18n/unicode/coll.h @@ -58,7 +58,7 @@ #include "unicode/uobject.h" #include "unicode/ucol.h" -#include "unicode/normlzr.h" +#include "unicode/unorm.h" #include "unicode/locid.h" #include "unicode/uniset.h" #include "unicode/umisc.h" @@ -158,7 +158,7 @@ class CollationKey; * @see CollationKey * @see CollationElementIterator * @see Locale -* @see Normalizer +* @see Normalizer2 * @version 2.0 11/15/01 */