@@ -63,6 +63,7 @@ UBool u_isdefined(UChar32);
63
63
#include < unicode/uiter.h>
64
64
#include < unicode/ubrk.h>
65
65
#include < unicode/uchar.h>
66
+ #include < unicode/uvernum.h>
66
67
67
68
#pragma clang diagnostic pop
68
69
@@ -288,11 +289,19 @@ swift::__swift_stdlib_unorm2_getNFCInstance(__swift_stdlib_UErrorCode *err) {
288
289
}
289
290
290
291
int32_t swift::__swift_stdlib_unorm2_normalize (
291
- const __swift_stdlib_UNormalizer2 *norm, const __swift_uint16_t *src,
292
- __swift_int32_t len, __swift_uint16_t *dst, __swift_int32_t capacity,
292
+ const __swift_stdlib_UNormalizer2 *norm, const __swift_stdlib_UChar *src,
293
+ __swift_int32_t len, __swift_stdlib_UChar *dst, __swift_int32_t capacity,
293
294
__swift_stdlib_UErrorCode *err) {
295
+ // TODO remove this compatibility when we require ICU >= 60 on Linux
296
+ #if defined(__APPLE__) || U_ICU_VERSION_MAJOR_NUM >= 60
294
297
return unorm2_normalize (ptr_cast<UNormalizer2>(norm), src, len, dst, capacity,
295
298
ptr_cast<UErrorCode>(err));
299
+ #else
300
+ return unorm2_normalize (ptr_cast<UNormalizer2>(norm),
301
+ reinterpret_cast <const UChar *>(src), len,
302
+ reinterpret_cast <UChar *>(dst), capacity,
303
+ ptr_cast<UErrorCode>(err));
304
+ #endif
296
305
}
297
306
298
307
__swift_int32_t swift::__swift_stdlib_unorm2_spanQuickCheckYes (
0 commit comments