time/Convert: fix GetTimeZoneOffset() on Windows
Was using the wrong parameter.
This commit is contained in:
parent
62229f14da
commit
672bc3ab67
2
NEWS
2
NEWS
@ -9,6 +9,8 @@ ver 0.21.22 (not yet released)
|
|||||||
- android: new mixer plugin for "sles" output
|
- android: new mixer plugin for "sles" output
|
||||||
* Android
|
* Android
|
||||||
- TV support
|
- TV support
|
||||||
|
* Windows
|
||||||
|
- fix time zone offset check
|
||||||
* fix build failures with uClibc-ng
|
* fix build failures with uClibc-ng
|
||||||
|
|
||||||
ver 0.21.21 (2020/03/19)
|
ver 0.21.21 (2020/03/19)
|
||||||
|
@ -77,15 +77,15 @@ static time_t
|
|||||||
GetTimeZoneOffset() noexcept
|
GetTimeZoneOffset() noexcept
|
||||||
{
|
{
|
||||||
time_t t = 1234567890;
|
time_t t = 1234567890;
|
||||||
struct tm tm;
|
|
||||||
tm.tm_isdst = 0;
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
struct tm *p = gmtime(&t);
|
struct tm *p = gmtime(&t);
|
||||||
#else
|
#else
|
||||||
|
struct tm tm;
|
||||||
|
tm.tm_isdst = 0;
|
||||||
struct tm *p = &tm;
|
struct tm *p = &tm;
|
||||||
gmtime_r(&t, p);
|
gmtime_r(&t, p);
|
||||||
#endif
|
#endif
|
||||||
return t - mktime(&tm);
|
return t - mktime(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* !__GLIBC__ */
|
#endif /* !__GLIBC__ */
|
||||||
|
Loading…
Reference in New Issue
Block a user