1
0
mirror of https://frontier.innolan.net/rainlance/amiga-tz.git synced 2025-11-21 05:53:37 +00:00

Simplify configuration of TM_GMTOFF and TM_ZONE.

* private.h, zdump.c (_GNU_SOURCE): New macro.
(TM_GMTOFF) [!NO_TM_GMTOFF]:
(TM_ZONE) [!NO_TM_ZONE]: Guess definition if not already defined.
* Makefile, NEWS: Document the above.
This commit is contained in:
Paul Eggert
2014-08-19 18:16:15 -07:00
parent 2f7599d358
commit 96eff14f85
4 changed files with 41 additions and 18 deletions

16
zdump.c
View File

@ -18,6 +18,9 @@
# include "private.h"
#endif
/* Enable tm_gmtoff and tm_zone on GNUish systems. */
#define _GNU_SOURCE 1
#include "stdio.h" /* for stdout, stderr, perror */
#include "string.h" /* for strcpy */
#include "sys/types.h" /* for time_t */
@ -73,6 +76,19 @@ typedef long intmax_t;
# endif
#endif
/* Infer TM_ZONE on systems where this information is known, but suppress
guessing if NO_TM_ZONE is defined. Similarly for TM_GMTOFF. */
#if (defined __GLIBC__ \
|| defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ \
|| (defined __APPLE__ && defined __MACH__))
# if !defined TM_GMTOFF && !defined NO_TM_GMTOFF
# define TM_GMTOFF tm_gmtoff
# endif
# if !defined TM_ZONE && !defined NO_TM_ZONE
# define TM_ZONE tm_zone
# endif
#endif
#ifndef ZDUMP_LO_YEAR
#define ZDUMP_LO_YEAR (-500)