Skip to content

Commit 59ea44d

Browse files
committed
Gate usages of uameasureformat on having the include for uameasureformat.h
1 parent a455cde commit 59ea44d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

CoreFoundation/Locale.subproj/CFLocale.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include <unicode/umsg.h> // ICU message formatting
3131
#include <unicode/ucol.h>
3232
#include <unicode/uvernum.h>
33-
#if U_ICU_VERSION_MAJOR_NUM > 53
33+
#if U_ICU_VERSION_MAJOR_NUM > 53 && __has_include(<unicode/uameasureformat.h>)
3434
#include <unicode/uameasureformat.h>
3535
#endif
3636
#endif
@@ -1269,6 +1269,7 @@ static bool __CFLocaleCopyTemperatureUnit(CFLocaleRef locale, bool user, CFTypeR
12691269
if (!done) {
12701270
char localeID[ULOC_FULLNAME_CAPACITY+ULOC_KEYWORD_AND_VALUES_CAPACITY];
12711271
if (CFStringGetCString(locale->_identifier, localeID, sizeof(localeID)/sizeof(char), kCFStringEncodingASCII)) {
1272+
#if U_ICU_VERSION_MAJOR_NUM > 53 && __has_include(<unicode/uameasureformat.h>)
12721273
UErrorCode icuStatus = U_ZERO_ERROR;
12731274
UAMeasureUnit unit;
12741275
int32_t unitCount = uameasfmt_getUnitsForUsage(localeID, "temperature", "weather", &unit, 1, &icuStatus);
@@ -1278,6 +1279,7 @@ static bool __CFLocaleCopyTemperatureUnit(CFLocaleRef locale, bool user, CFTypeR
12781279
}
12791280
done = true;
12801281
}
1282+
#endif
12811283
}
12821284
}
12831285
if (!done) {

0 commit comments

Comments
 (0)