test(libc): use long for the host daylight bias in the Windows time zone diagnostic

_get_dstbias takes a long pointer, so the int variable added in the previous commit did not compile on Windows. The variable and its format specifier are now long.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
xXPBSXxandClaude Sonnet 5.5 committed 2026-10-24 12:16:13 +02:00
1 parent 6558457483
commit e59cd20f0c
1 file changed
+2 -2
+2 -2
View File
@@ -322,13 +322,13 @@ static void CheckPosixFormZoneOffsets() {
Require(localtime_s_nid_postfix(&expected.timer, &local) == &local, "Local conversion in a POSIX-form zone failed");
if (local.tm_gmtoff != expected.offset || local.tm_isdst != expected.isdst) {
long hostTimezone = -1;
int hostDstBias = -1;
long hostDstBias = -1;
_get_timezone(&hostTimezone);
_get_dstbias(&hostDstBias);
std::tm hostLocal{};
const __time64_t hostTimer = expected.timer;
_localtime64_s(&hostLocal, &hostTimer);
std::fprintf(stderr, "%s at %lld: offset %ld daylight %d, expected %ld daylight %d (host timezone %ld dstbias %d daylight %d)\n", expected.zone, static_cast<long long>(expected.timer), static_cast<long>(local.tm_gmtoff), local.tm_isdst, expected.offset, expected.isdst, hostTimezone, hostDstBias, hostLocal.tm_isdst);
std::fprintf(stderr, "%s at %lld: offset %ld daylight %d, expected %ld daylight %d (host timezone %ld dstbias %ld daylight %d)\n", expected.zone, static_cast<long long>(expected.timer), static_cast<long>(local.tm_gmtoff), local.tm_isdst, expected.offset, expected.isdst, hostTimezone, hostDstBias, hostLocal.tm_isdst);
std::abort();
}
}