5353
5454#include "icu.h"
5555
56- #define HAVE_SET_MAX_VARIABLE 1
5756#define UDAT_STANDALONE_SHORTER_WEEKDAYS 1
5857
5958#endif
6362#if !defined(STATIC_ICU )
6463
6564#if !defined(TARGET_ANDROID )
66- // (U_ICU_VERSION_MAJOR_NUM < 52)
67- // The following APIs are not supported in the ICU versions less than 52. We need to define them manually.
68- // We have to do runtime check before using the pointers to these APIs. That is why these are listed in the FOR_ALL_OPTIONAL_ICU_FUNCTIONS list.
69- U_CAPI void U_EXPORT2 ucol_setMaxVariable (UCollator * coll , UColReorderCode group , UErrorCode * pErrorCode );
70- U_CAPI int32_t U_EXPORT2 ucal_getTimeZoneIDForWindowsID (const UChar * winid , int32_t len , const char * region , UChar * id , int32_t idCapacity , UErrorCode * status );
71- U_CAPI int32_t U_EXPORT2 ucal_getWindowsTimeZoneID (const UChar * id , int32_t len , UChar * winid , int32_t winidCapacity , UErrorCode * status );
72-
7365// (U_ICU_VERSION_MAJOR_NUM < 71)
7466// The following API is not supported in the ICU versions less than 71. We need to define it manually.
7567// We have to do runtime check before using the pointers to this API. That is why these are listed in the FOR_ALL_OPTIONAL_ICU_FUNCTIONS list.
7668U_CAPI UCollator * U_EXPORT2 ucol_clone (const UCollator * coll , UErrorCode * status );
7769
78- // ucol_setVariableTop is a deprecated function on the newer ICU versions and ucol_setMaxVariable should be used instead.
79- // As we can run against ICU versions which do not support ucol_setMaxVariable, we will dynamically try to get the pointer
80- // to ucol_setVariableTop when we could not get a pointer to ucol_setMaxVariable.
81- typedef uint32_t (U_EXPORT2 * ucol_setVariableTop_func )(UCollator * coll , const UChar * varTop , int32_t len , UErrorCode * status );
82-
8370// ucol_safeClone is deprecated in ICU version 71. We have to handle it manually to avoid getting a build break when referencing it in the code.
8471typedef UCollator * (U_EXPORT2 * ucol_safeClone_func )(const UCollator * coll , void * stackBuffer , int32_t * pBufferSize , UErrorCode * status );
8572
8673#else // !defined(TARGET_ANDROID)
8774
88- typedef uint32_t (* ucol_setVariableTop_func )(UCollator * coll , const UChar * varTop , int32_t len , UErrorCode * status );
8975typedef UCollator * (* ucol_safeClone_func )(const UCollator * coll , void * stackBuffer , int32_t * pBufferSize , UErrorCode * status );
9076
9177#endif // !defined(TARGET_ANDROID)
9278
93- extern ucol_setVariableTop_func ucol_setVariableTop_ptr ;
9479extern ucol_safeClone_func ucol_safeClone_ptr ;
9580
9681// List of all functions from the ICU libraries that are used in the System.Globalization.Native.so
@@ -114,6 +99,8 @@ extern ucol_safeClone_func ucol_safeClone_ptr;
11499 PER_FUNCTION_BLOCK(ucal_getLimit, libicui18n, true) \
115100 PER_FUNCTION_BLOCK(ucal_getNow, libicui18n, true) \
116101 PER_FUNCTION_BLOCK(ucal_getTimeZoneDisplayName, libicui18n, true) \
102+ PER_FUNCTION_BLOCK(ucal_getTimeZoneIDForWindowsID, libicui18n, true) \
103+ PER_FUNCTION_BLOCK(ucal_getWindowsTimeZoneID, libicui18n, true) \
117104 PER_FUNCTION_BLOCK(ucal_open, libicui18n, true) \
118105 PER_FUNCTION_BLOCK(ucal_openTimeZoneIDEnumeration, libicui18n, true) \
119106 PER_FUNCTION_BLOCK(ucal_set, libicui18n, true) \
@@ -131,6 +118,7 @@ extern ucol_safeClone_func ucol_safeClone_ptr;
131118 PER_FUNCTION_BLOCK(ucol_openElements, libicui18n, true) \
132119 PER_FUNCTION_BLOCK(ucol_openRules, libicui18n, true) \
133120 PER_FUNCTION_BLOCK(ucol_setAttribute, libicui18n, true) \
121+ PER_FUNCTION_BLOCK(ucol_setMaxVariable, libicui18n, true) \
134122 PER_FUNCTION_BLOCK(ucol_strcoll, libicui18n, true) \
135123 PER_FUNCTION_BLOCK(udat_close, libicui18n, true) \
136124 PER_FUNCTION_BLOCK(udat_countSymbols, libicui18n, true) \
@@ -215,9 +203,6 @@ extern ucol_safeClone_func ucol_safeClone_ptr;
215203// The following are the list of the ICU APIs which are optional. If these APIs exist in the ICU version we load at runtime, then we'll use it.
216204// Otherwise, we'll just not provide the functionality to users which needed these APIs.
217205#define FOR_ALL_OPTIONAL_ICU_FUNCTIONS \
218- PER_FUNCTION_BLOCK(ucal_getWindowsTimeZoneID, libicui18n, false) \
219- PER_FUNCTION_BLOCK(ucal_getTimeZoneIDForWindowsID, libicui18n, false) \
220- PER_FUNCTION_BLOCK(ucol_setMaxVariable, libicui18n, false) \
221206 PER_FUNCTION_BLOCK(ucol_clone, libicui18n, false)
222207
223208#define FOR_ALL_ICU_FUNCTIONS \
@@ -343,9 +328,6 @@ FOR_ALL_ICU_FUNCTIONS
343328
344329#else // !defined(STATIC_ICU)
345330
346- #define ucal_getWindowsTimeZoneID_ptr ucal_getWindowsTimeZoneID
347- #define ucal_getTimeZoneIDForWindowsID_ptr ucal_getTimeZoneIDForWindowsID
348-
349331#if defined(TARGET_MACCATALYST ) || defined(TARGET_IOS ) || defined(TARGET_TVOS )
350332const char * GlobalizationNative_GetICUDataPathRelativeToAppBundleRoot (const char * path );
351333const char * GlobalizationNative_GetICUDataPathFallback (void );
@@ -360,7 +342,7 @@ const char* GlobalizationNative_GetICUDataPathFallback(void);
360342 * "Safe" macro, checks for a valid code point.
361343 * Converts code points outside of Basic Multilingual Plane into
362344 * corresponding surrogate pairs if sufficient space in the string.
363- * High surrogate range: 0xD800 - 0xDBFF
345+ * High surrogate range: 0xD800 - 0xDBFF
364346 * Low surrogate range: 0xDC00 - 0xDFFF
365347 * If the code point is not valid or a trail surrogate does not fit,
366348 * then isError is set to true.
0 commit comments