Skip to content

Commit d4c013c

Browse files
authored
Merge pull request #14674 from compnerd/icu-shims
Shims: adjust the ICU interface
2 parents 3d793d2 + cd58f5c commit d4c013c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

stdlib/public/SwiftShims/UnicodeShims.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,15 @@ typedef enum __swift_stdlib_UBreakIteratorType {
294294
} __swift_stdlib_UBreakIteratorType;
295295

296296
typedef struct __swift_stdlib_UBreakIterator __swift_stdlib_UBreakIterator;
297+
#if defined(__APPLE__)
297298
typedef __swift_uint16_t __swift_stdlib_UChar;
299+
#else
300+
#if defined(__cplusplus)
301+
typedef char16_t __swift_stdlib_UChar;
302+
#else
303+
typedef __swift_uint16_t __swift_stdlib_UChar;
304+
#endif
305+
#endif
298306

299307
SWIFT_RUNTIME_STDLIB_INTERFACE
300308
void __swift_stdlib_ubrk_close(__swift_stdlib_UBreakIterator *bi);

stdlib/public/stubs/UnicodeNormalization.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,8 @@ void swift::__swift_stdlib_ubrk_close(
301301

302302
swift::__swift_stdlib_UBreakIterator *swift::__swift_stdlib_ubrk_open(
303303
swift::__swift_stdlib_UBreakIteratorType type, const char *locale,
304-
const uint16_t *text, int32_t textLength, __swift_stdlib_UErrorCode *status) {
304+
const __swift_stdlib_UChar *text, int32_t textLength,
305+
__swift_stdlib_UErrorCode *status) {
305306
return ptr_cast<swift::__swift_stdlib_UBreakIterator>(
306307
ubrk_open(static_cast<UBreakIteratorType>(type), locale,
307308
reinterpret_cast<const UChar *>(text), textLength,

0 commit comments

Comments
 (0)