README.md: more timegm() documentation

This commit is contained in:
Kosma Moczek 2014-06-18 12:13:14 +02:00
parent 7786885eef
commit 23e2f950c5
2 changed files with 4 additions and 3 deletions

View File

@ -124,8 +124,9 @@ typing ``make``.
a workaround, use the ``-ffunction-sections -Wl,--gc-sections`` linker flags
(or equivalent) to remove the unused functions (parsers) from the final image.
* Some systems lack ``timegm``. On these systems, the recommended course of
action is to build with ``-Dtimegm=mktime`` - assuming the system runs in the
default ``UTC`` timezone.
action is to build with ``-Dtimegm=mktime`` which will work correctly as long
the system runs in the default ``UTC`` timezone. Native Windows builds should
use ``-Dtimegm=_mkgmtime`` instead which will work correctly in all timezones.
## Bugs

View File

@ -531,7 +531,7 @@ int minmea_gettimeofday(struct timeval *tv, const struct minmea_date *date, cons
tm.tm_min = time_->minutes;
tm.tm_sec = time_->seconds;
time_t timestamp = timegm(&tm);
time_t timestamp = timegm(&tm); /* See README.md if your system lacks timegm(). */
if (timestamp != -1) {
tv->tv_sec = timestamp;
tv->tv_usec = time_->microseconds;