Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Unified Diff: src/runtime/runtime-i18n.cc

Issue 2738503008: Prepare for ICU's switch to char16_t (Closed)
Patch Set: fix format Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/i18n.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-i18n.cc
diff --git a/src/runtime/runtime-i18n.cc b/src/runtime/runtime-i18n.cc
index 0b45381914641a824e36e99eaa0d315bf96252aa..4ea7e1d31e444648e72d3dff0596a3ea85c26c57 100644
--- a/src/runtime/runtime-i18n.cc
+++ b/src/runtime/runtime-i18n.cc
@@ -43,6 +43,8 @@
#include "unicode/uloc.h"
#include "unicode/unistr.h"
#include "unicode/unum.h"
+#include "unicode/ustring.h"
+#include "unicode/uvernum.h"
#include "unicode/uversion.h"
@@ -609,8 +611,15 @@ RUNTIME_FUNCTION(Runtime_InternalCompare) {
String::FlatContent flat2 = string2->GetFlatContent();
std::unique_ptr<uc16[]> sap1;
std::unique_ptr<uc16[]> sap2;
+#if U_ICU_VERSION_MAJOR_NUM < 59
const UChar* string_val1 = GetUCharBufferFromFlat(flat1, &sap1, length1);
const UChar* string_val2 = GetUCharBufferFromFlat(flat2, &sap2, length2);
+#else
+ const char16_t* string_val1 = reinterpret_cast<const char16_t*>(
+ GetUCharBufferFromFlat(flat1, &sap1, length1));
+ const char16_t* string_val2 = reinterpret_cast<const char16_t*>(
+ GetUCharBufferFromFlat(flat2, &sap2, length2));
jungshik at Google 2017/03/08 22:56:53 Markus, can you change (or add an overload to) icu
+#endif
result =
collator->compare(string_val1, length1, string_val2, length2, status);
}
« no previous file with comments | « src/i18n.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698