diff options
-rw-r--r-- | config/header.mk | 1 | ||||
-rw-r--r-- | config/tm-gmtoff.c | 9 | ||||
-rw-r--r-- | src/parse.c | 2 |
3 files changed, 11 insertions, 1 deletions
diff --git a/config/header.mk b/config/header.mk index 04fbdec..38f1277 100644 --- a/config/header.mk +++ b/config/header.mk @@ -25,6 +25,7 @@ HEADERS := \ ${GEN}/strerror-l.h \ ${GEN}/strerror-r-gnu.h \ ${GEN}/strerror-r-posix.h \ + ${GEN}/tm-gmtoff.h \ ${GEN}/uselocale.h ${GEN}/config.h: ${HEADERS} diff --git a/config/tm-gmtoff.c b/config/tm-gmtoff.c new file mode 100644 index 0000000..543df48 --- /dev/null +++ b/config/tm-gmtoff.c @@ -0,0 +1,9 @@ +// Copyright © Tavian Barnes <tavianator@tavianator.com> +// SPDX-License-Identifier: 0BSD + +#include <time.h> + +int main(void) { + struct tm tm = {0}; + return tm.tm_gmtoff; +} diff --git a/src/parse.c b/src/parse.c index c2ae58f..a1155c0 100644 --- a/src/parse.c +++ b/src/parse.c @@ -1755,7 +1755,7 @@ static int parse_reftime(const struct bfs_parser *parser, struct bfs_expr *expr) fprintf(stderr, " - %04d-%02d-%02d\n", year, month, tm.tm_mday); fprintf(stderr, " - %04d-%02d-%02dT%02d:%02d:%02d\n", year, month, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); -#if __FreeBSD__ +#if BFS_HAS_TM_GMTOFF int gmtoff = tm.tm_gmtoff; #else int gmtoff = -timezone; |