Shims: adjust the ICU interface

The default ICU build will change the underlying type of the UChar type,
with C++ using the builtin `char16_t` rather than `unsigned short`.
This adjusts the interface to account for that.  I've verified across
Apple's implementation that they always use the `unsigned short` as the
type for `UChar`.  Since we cannot guarantee that the ICU interfaces are
built the same way on all targets, especially when using the underlying
system's ICU.

Adjust the stubs implementation declaration to match the ICU header's
declaration.
This commit is contained in:
Saleem Abdulrasool
2018-02-15 21:02:48 -08:00
parent 15e84411f8
commit cd58f5c1c9
2 changed files with 10 additions and 1 deletions

View File

@@ -301,7 +301,8 @@ void swift::__swift_stdlib_ubrk_close(
swift::__swift_stdlib_UBreakIterator *swift::__swift_stdlib_ubrk_open(
swift::__swift_stdlib_UBreakIteratorType type, const char *locale,
const uint16_t *text, int32_t textLength, __swift_stdlib_UErrorCode *status) {
const __swift_stdlib_UChar *text, int32_t textLength,
__swift_stdlib_UErrorCode *status) {
return ptr_cast<swift::__swift_stdlib_UBreakIterator>(
ubrk_open(static_cast<UBreakIteratorType>(type), locale,
reinterpret_cast<const UChar *>(text), textLength,