aboutsummaryrefslogtreecommitdiff
path: root/win32/timegm.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* win32: fix warning in timegm(3)Ron Yorston2022-10-251-1/+0
| | | | | | | | | | | Building on Windows using w64devkit resulted in a new warning in timegm(3). The compiler didn't like a reference to the unnamed temporary in: if (!is_leap) is_leap = &(int){0}; is_leap is always non-NULL in the limited version of the code used here so the offending line can simply be removed.
* win32: limited version of timegm(3)Ron Yorston2021-09-181-84/+13
| | | | | | | | | | | | | timegm(3) from musl checks that the calculated time_t value can be broken out into a struct tm without overflow. The limiting factor is that tm_year is an int. Our only use of timegm(3) is followed by a call to localtime(3). The Microsoft version of this only works for time_t values between 0 and INT_MAX (32-bit) or 0 and 32535215999 (64-bit). Enforce these limits in timegm(3), thus avoiding the use of musl's __secs_to_tm() and saving 624 bytes.
* win32: changes to allow timezones in datesRon Yorston2021-09-171-0/+205
Create mingw_strptime() to return timezone offset as a separate argument (since Microsoft's struct tm doesn't have the required member). Import timegm() from musl. Update parse_datestr() to use mingw_strptime(). Enable FEATURE_TIMEZONE in the default configuration. GitHub issue #230.