README.md: more timegm() documentation
This commit is contained in:
parent
7786885eef
commit
23e2f950c5
@ -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
|
||||
|
||||
|
2
minmea.c
2
minmea.c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user