Skip to content

Shims: adjust the ICU interface #14674

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions stdlib/public/SwiftShims/UnicodeShims.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,15 @@ typedef enum __swift_stdlib_UBreakIteratorType {
} __swift_stdlib_UBreakIteratorType;

typedef struct __swift_stdlib_UBreakIterator __swift_stdlib_UBreakIterator;
#if defined(__APPLE__)
typedef __swift_uint16_t __swift_stdlib_UChar;
#else
#if defined(__cplusplus)
typedef char16_t __swift_stdlib_UChar;
#else
typedef __swift_uint16_t __swift_stdlib_UChar;
#endif
#endif

SWIFT_RUNTIME_STDLIB_INTERFACE
void __swift_stdlib_ubrk_close(__swift_stdlib_UBreakIterator *bi);
Expand Down
3 changes: 2 additions & 1 deletion stdlib/public/stubs/UnicodeNormalization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down