1
0
mirror of https://frontier.innolan.net/rainlance/amiga-tz.git synced 2025-11-21 16:04:13 +00:00

Add support for testing time_t types other than the system's.

This makes it easier to test on (say) Debian, even if we're
testing the time_t type on (say) NetBSD.  NetBSD uses 64-bit
time_t on 32-bit hosts, and this lets us test a NetBSD-style
implementation (32-bit 'long', 64-bit time_t) on a 32-bit Debian host.
* Makefile: Update comments to talk about TIME_T_FLOATING and time_tz.
Sort the comments.
* private.h (restrict): Define to empty with older compilers.
'restrict' is now needed, to define gmtime_r and localtime_r in
standard ways when time_tz is defined.
Make the following changes if time_tz is defined:
(sys_time, time): New static functions.  The former is the system
'time' function that applies to the system time_t, the latter
our function that applies to our time_t.
(time_t, ctime, ctime_r, difftime, gmtime, gmtime_r, localtime)
(localtime_r, mktime): Rename to tz_time_t, tz_ctime, etc.,
via macros.  Declare the renamed versions.
* zdump.8: Document new options -V, -t.
* zdump.c: Include private.h if time_tz is defined.
(INITIALIZE): Remove; no longer needed.
(absolute_min_time, absolute_max_time): Work even if time_t
is wider than intmax_t, which can be true with GCC and __int128_t.
Use the new TIME_T_FLOATING macro for this.
(usage): Document new flags.
(main): Support them.
This commit is contained in:
Paul Eggert
2013-05-27 14:01:55 -07:00
parent 13d50f6f74
commit 8a883a64cb
4 changed files with 166 additions and 63 deletions

17
zdump.8
View File

@ -37,15 +37,28 @@ Each line ends with
if the given time is Daylight Saving Time or
.B isdst=0
otherwise.
.B \-V
Like
.BR \-v ,
except omit the times relative to the extreme time values.
This generates output that is easier to compare to that of
implementations with different time representations.
.TP
.BI "\-c " [loyear,]hiyear
Cut off verbose output near the start of the given year(s).
.TP
.BI "\-t " [lotime,]hitime
Cut off verbose output at the start of the given time(s),
given in seconds since 1970-01-01 00:00:00 UTC.
By default,
the program cuts off verbose output near the starts of the years -500 and 2500.
the program cuts off verbose output near the starts of the years
\-500 and 2500.
.SH LIMITATIONS
The
.B \-v
option may not be used on systems with floating-point time_t values
and
.B \-V
options may not be used on systems with floating-point time_t values
that are neither float nor double.
.PP
Time discontinuities are found by sampling the results returned by localtime