Hash :
d3bc6917
Author :
Date :
2015-07-27T16:41:17
time_rz: port better to MinGW Don't change tzname, as this makes MinGW dump core (Bug#21020). Instead, store the tzname copy in the struct tm_zone object. Problem reported by Eli Zaretskii in: http://bugs.gnu.org/21020#48 * lib/strftime.c [!_LIBC]: * lib/time_rz.c: Include time-internal.h. * lib/strftime.c (strftime_case_) [!HAVE_TM_ZONE]: Infer the zone name from *TZ rather than from TZNAME, doable because *TZ now has a tzname_copy member. * lib/time-internal.h: New file, with contents taken from lib/time_rz.c. It's separate because strftime.c now accesses struct tm_zone members. (struct tm_zone) [HAVE_TZNAME && !HAVE_TM_ZONE]: New member tzname_copy. * lib/time_rz.c (struct tm_zone): Move to time-internal.h. (tzalloc) [HAVE_TZNAME && !HAVE_TM_ZONE]: Initialize tzname_copy member. (save_abbr) [HAVE_TZNAME && !HAVE_TM_ZONE]: Save abbreviation in tzname_copy member. (revert_tz) [HAVE_TZNAME]: Remove no-longer-needed tzname saving. (restore_tzname): Remove; no longer needed. All calls removed. * modules/time_rz (Files): Add lib/time-internal.h.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
Description:
Reentrant time zone functions: localtime_rz, mktime_z, etc.
Comment:
This implements the NetBSD-inspired extensions to <time.h>, which
defines a type timezone_t and associated allocation functions tzalloc
and tzfree, along with two functions localtime_rz and mktime_z that
are like localtime_r and mktime except they have a new leading
timezone_t argument. Time zone abbreviation strings have lifetimes
equal to the corresponding struct tm or timezone_t object (whichever
is less). tzalloc (X) yields a time zone object equivalent to setting
the TZ environment variable to X. tzalloc (NULL) is the same as an
unset TZ environment variable. (timezone_t) 0 stands for UTC.
Files:
lib/time-internal.h
lib/time_rz.c
m4/time_rz.m4
Depends-on:
extensions
flexmember [test "$HAVE_TIMEZONE_T" = 0]
setenv [test "$HAVE_TIMEZONE_T" = 0]
stdbool [test "$HAVE_TIMEZONE_T" = 0]
time_r [test "$HAVE_TIMEZONE_T" = 0]
timegm [test "$HAVE_TIMEZONE_T" = 0]
unsetenv [test "$HAVE_TIMEZONE_T" = 0]
configure.ac:
gl_TIME_RZ
if test "$HAVE_TIMEZONE_T" = 0; then
AC_LIBOBJ([time_rz])
fi
gl_TIME_MODULE_INDICATOR([time_rz])
Makefile.am:
Include:
<time.h>
License:
LGPL
Maintainer:
Paul Eggert