Skip to content

Commit a3880ed

Browse files
committed
Gate usages of uameasureformat on having the include for uameasureformat.h
1 parent a1d5a67 commit a3880ed

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
@@ -1264,6 +1264,7 @@ static bool __CFLocaleCopyTemperatureUnit(CFLocaleRef locale, bool user, CFTypeR
12641264
if (!done) {
12651265
char localeID[ULOC_FULLNAME_CAPACITY+ULOC_KEYWORD_AND_VALUES_CAPACITY];
12661266
if (CFStringGetCString(locale->_identifier, localeID, sizeof(localeID)/sizeof(char), kCFStringEncodingASCII)) {
1267+
#if U_ICU_VERSION_MAJOR_NUM > 53 && __has_include(<unicode/uameasureformat.h>)
12671268
UErrorCode icuStatus = U_ZERO_ERROR;
12681269
UAMeasureUnit unit;
12691270
int32_t unitCount = uameasfmt_getUnitsForUsage(localeID, "temperature", "weather", &unit, 1, &icuStatus);
@@ -1273,6 +1274,7 @@ static bool __CFLocaleCopyTemperatureUnit(CFLocaleRef locale, bool user, CFTypeR
12731274
}
12741275
done = true;
12751276
}
1277+
#endif
12761278
}
12771279
}
12781280
if (!done) {

0 commit comments

Comments
 (0)