Enclose changes into preprocessor conditional

This commit is contained in:
Hugo Melder 2022-08-08 11:08:03 +02:00
parent b55da09618
commit 3aa2d1912c

View file

@ -1447,17 +1447,23 @@ static NSMapTable *absolutes = 0;
SetThreadUILanguage(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
dst = GetTimeZoneInformation(&tz);
SetThreadUILanguage(origLangID);
#else
dst = GetTimeZoneInformation(&tz);
#endif
localZoneSource = @"function: 'GetTimeZoneInformation()'";
// Only tz.StandardName time zone conversions are supported, as
// the Zone-Tzid table lacks all daylight time conversions:
// e.g. 'W. Europe Daylight Time' <-> 'Europe/Berlin' is not listed.
//
// See: https://unicode-org.github.io/cldr-staging/charts/latest/supplemental/zone_tzid.html
tzName = tz.StandardName;
#else
dst = GetTimeZoneInformation(&tz);
if (dst == TIME_ZONE_ID_DAYLIGHT)
tzName = tz.DaylightName;
else
tzName = tz.StandardName;
#endif
localZoneSource = @"function: 'GetTimeZoneInformation()'";
#if defined(_MSC_VER) && defined(UCAL_H)
// Convert Windows timezone name to IANA identifier