2626#endif
2727
2828#include " swift/shims/UnicodeData.h"
29- #include < limits >
29+ #include < stdint.h >
3030
3131SWIFT_RUNTIME_STDLIB_INTERNAL
3232__swift_uint64_t _swift_stdlib_getBinaryProperties (__swift_uint32_t scalar) {
@@ -124,7 +124,7 @@ __swift_uint8_t _swift_stdlib_getNumericType(__swift_uint32_t scalar) {
124124 // If we made it out here, then our scalar was not found in the composition
125125 // array.
126126 // Return the max here to indicate that we couldn't find one.
127- return std::numeric_limits< __swift_uint8_t >:: max () ;
127+ return UINT8_MAX ;
128128#endif
129129}
130130
@@ -153,7 +153,7 @@ const char *_swift_stdlib_getNameAlias(__swift_uint32_t scalar) {
153153 _swift_stdlib_nameAlias,
154154 _swift_stdlib_nameAlias_ranks);
155155
156- if (dataIdx == std::numeric_limits< __swift_intptr_t >:: max () ) {
156+ if (dataIdx == INTPTR_MAX ) {
157157 return nullptr ;
158158 }
159159
@@ -171,7 +171,7 @@ __swift_int32_t _swift_stdlib_getMapping(__swift_uint32_t scalar,
171171 _swift_stdlib_mappings,
172172 _swift_stdlib_mappings_ranks);
173173
174- if (dataIdx == std::numeric_limits< __swift_intptr_t >:: max () ) {
174+ if (dataIdx == INTPTR_MAX ) {
175175 return 0 ;
176176 }
177177
@@ -219,7 +219,7 @@ const __swift_uint8_t *_swift_stdlib_getSpecialMapping(__swift_uint32_t scalar,
219219 _swift_stdlib_special_mappings,
220220 _swift_stdlib_special_mappings_ranks);
221221
222- if (dataIdx == std::numeric_limits< __swift_intptr_t >:: max () ) {
222+ if (dataIdx == INTPTR_MAX ) {
223223 return nullptr ;
224224 }
225225
@@ -261,7 +261,7 @@ __swift_intptr_t _swift_stdlib_getScalarName(__swift_uint32_t scalar,
261261#else
262262 auto setOffset = _swift_stdlib_names_scalar_sets[scalar >> 7 ];
263263
264- if (setOffset == std::numeric_limits< __swift_uint16_t >:: max () ) {
264+ if (setOffset == UINT16_MAX ) {
265265 return 0 ;
266266 }
267267
@@ -385,7 +385,7 @@ __swift_uint16_t _swift_stdlib_getAge(__swift_uint32_t scalar) {
385385 // If we made it out here, then our scalar was not found in the composition
386386 // array.
387387 // Return the max here to indicate that we couldn't find one.
388- return std::numeric_limits< __swift_uint16_t >:: max () ;
388+ return UINT16_MAX ;
389389#endif
390390}
391391
@@ -427,7 +427,7 @@ __swift_uint8_t _swift_stdlib_getGeneralCategory(__swift_uint32_t scalar) {
427427 // If we made it out here, then our scalar was not found in the composition
428428 // array.
429429 // Return the max here to indicate that we couldn't find one.
430- return std::numeric_limits< __swift_uint8_t >:: max () ;
430+ return UINT8_MAX ;
431431#endif
432432}
433433
@@ -485,7 +485,7 @@ __swift_uint8_t _swift_stdlib_getScript(__swift_uint32_t scalar) {
485485 // all in the array. This should never happen because the array represents all
486486 // scalars from 0x0 to 0x10FFFF, but if somehow this branch gets reached,
487487 // return 255 to indicate a failure.
488- return std::numeric_limits< __swift_uint8_t >:: max () ;
488+ return UINT8_MAX ;
489489#endif
490490}
491491
@@ -501,7 +501,7 @@ const __swift_uint8_t *_swift_stdlib_getScriptExtensions(__swift_uint32_t scalar
501501
502502 // If we don't have an index into the data indices, then this scalar has no
503503 // script extensions
504- if (dataIdx == std::numeric_limits< __swift_intptr_t >:: max () ) {
504+ if (dataIdx == INTPTR_MAX ) {
505505 return 0 ;
506506 }
507507
0 commit comments