53
53
54
54
#include "icu.h"
55
55
56
- #define HAVE_SET_MAX_VARIABLE 1
57
56
#define UDAT_STANDALONE_SHORTER_WEEKDAYS 1
58
57
59
58
#endif
63
62
#if !defined(STATIC_ICU )
64
63
65
64
#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
-
73
65
// (U_ICU_VERSION_MAJOR_NUM < 71)
74
66
// The following API is not supported in the ICU versions less than 71. We need to define it manually.
75
67
// 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.
76
68
U_CAPI UCollator * U_EXPORT2 ucol_clone (const UCollator * coll , UErrorCode * status );
77
69
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
-
83
70
// 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.
84
71
typedef UCollator * (U_EXPORT2 * ucol_safeClone_func )(const UCollator * coll , void * stackBuffer , int32_t * pBufferSize , UErrorCode * status );
85
72
86
73
#else // !defined(TARGET_ANDROID)
87
74
88
- typedef uint32_t (* ucol_setVariableTop_func )(UCollator * coll , const UChar * varTop , int32_t len , UErrorCode * status );
89
75
typedef UCollator * (* ucol_safeClone_func )(const UCollator * coll , void * stackBuffer , int32_t * pBufferSize , UErrorCode * status );
90
76
91
77
#endif // !defined(TARGET_ANDROID)
92
78
93
- extern ucol_setVariableTop_func ucol_setVariableTop_ptr ;
94
79
extern ucol_safeClone_func ucol_safeClone_ptr ;
95
80
96
81
// 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;
114
99
PER_FUNCTION_BLOCK(ucal_getLimit, libicui18n, true) \
115
100
PER_FUNCTION_BLOCK(ucal_getNow, libicui18n, true) \
116
101
PER_FUNCTION_BLOCK(ucal_getTimeZoneDisplayName, libicui18n, true) \
102
+ PER_FUNCTION_BLOCK(ucal_getTimeZoneIDForWindowsID, libicui18n, true) \
103
+ PER_FUNCTION_BLOCK(ucal_getWindowsTimeZoneID, libicui18n, true) \
117
104
PER_FUNCTION_BLOCK(ucal_open, libicui18n, true) \
118
105
PER_FUNCTION_BLOCK(ucal_openTimeZoneIDEnumeration, libicui18n, true) \
119
106
PER_FUNCTION_BLOCK(ucal_set, libicui18n, true) \
@@ -131,6 +118,7 @@ extern ucol_safeClone_func ucol_safeClone_ptr;
131
118
PER_FUNCTION_BLOCK(ucol_openElements, libicui18n, true) \
132
119
PER_FUNCTION_BLOCK(ucol_openRules, libicui18n, true) \
133
120
PER_FUNCTION_BLOCK(ucol_setAttribute, libicui18n, true) \
121
+ PER_FUNCTION_BLOCK(ucol_setMaxVariable, libicui18n, true) \
134
122
PER_FUNCTION_BLOCK(ucol_strcoll, libicui18n, true) \
135
123
PER_FUNCTION_BLOCK(udat_close, libicui18n, true) \
136
124
PER_FUNCTION_BLOCK(udat_countSymbols, libicui18n, true) \
@@ -215,9 +203,6 @@ extern ucol_safeClone_func ucol_safeClone_ptr;
215
203
// 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.
216
204
// Otherwise, we'll just not provide the functionality to users which needed these APIs.
217
205
#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) \
221
206
PER_FUNCTION_BLOCK(ucol_clone, libicui18n, false)
222
207
223
208
#define FOR_ALL_ICU_FUNCTIONS \
@@ -343,9 +328,6 @@ FOR_ALL_ICU_FUNCTIONS
343
328
344
329
#else // !defined(STATIC_ICU)
345
330
346
- #define ucal_getWindowsTimeZoneID_ptr ucal_getWindowsTimeZoneID
347
- #define ucal_getTimeZoneIDForWindowsID_ptr ucal_getTimeZoneIDForWindowsID
348
-
349
331
#if defined(TARGET_MACCATALYST ) || defined(TARGET_IOS ) || defined(TARGET_TVOS )
350
332
const char * GlobalizationNative_GetICUDataPathRelativeToAppBundleRoot (const char * path );
351
333
const char * GlobalizationNative_GetICUDataPathFallback (void );
@@ -360,7 +342,7 @@ const char* GlobalizationNative_GetICUDataPathFallback(void);
360
342
* "Safe" macro, checks for a valid code point.
361
343
* Converts code points outside of Basic Multilingual Plane into
362
344
* corresponding surrogate pairs if sufficient space in the string.
363
- * High surrogate range: 0xD800 - 0xDBFF
345
+ * High surrogate range: 0xD800 - 0xDBFF
364
346
* Low surrogate range: 0xDC00 - 0xDFFF
365
347
* If the code point is not valid or a trail surrogate does not fit,
366
348
* then isError is set to true.
0 commit comments