>From 5afb29f59a6f1764eb3059cc0485fb50202afea1 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 14 Aug 2020 20:03:33 +0200 Subject: [PATCH 2/3] nstrftime: Assume tzset exists. * lib/nstrftime.c (HAVE_TZSET): Remove macro. (__strftime_internal): Test my_strftime, not HAVE_TZSET. * m4/nstrftime.m4 (gl_FUNC_GNU_STRFTIME): Don't test for tzset. --- ChangeLog | 5 +++++ lib/nstrftime.c | 6 ++---- m4/nstrftime.m4 | 4 +--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 65070d7..803c67d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2020-08-14 Bruno Haible + nstrftime: Assume tzset exists. + * lib/nstrftime.c (HAVE_TZSET): Remove macro. + (__strftime_internal): Test my_strftime, not HAVE_TZSET. + * m4/nstrftime.m4 (gl_FUNC_GNU_STRFTIME): Don't test for tzset. + mktime, mktime-internal: Assume tzset exists. * lib/mktime.c (my_tzset): Assume HAVE_TZSET is 1. * m4/mktime.m4 (gl_FUNC_MKTIME_WORKS): Don't test for tzset. diff --git a/lib/nstrftime.c b/lib/nstrftime.c index 791fbff..35b65bb 100644 --- a/lib/nstrftime.c +++ b/lib/nstrftime.c @@ -21,7 +21,6 @@ # define HAVE_TM_GMTOFF 1 # define HAVE_TM_ZONE 1 # define HAVE_TZNAME 1 -# define HAVE_TZSET 1 # include "../locale/localeinfo.h" #else # include @@ -389,7 +388,6 @@ iso_week_days (int yday, int wday) #endif #ifdef my_strftime -# undef HAVE_TZSET # define extra_args , tz, ns # define extra_args_spec , timezone_t tz, int ns #else @@ -523,7 +521,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) { /* POSIX.1 requires that local time zone information be used as though strftime called tzset. */ -# if HAVE_TZSET +# ifndef my_strftime if (!*tzset_called) { tzset (); @@ -1417,7 +1415,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) /* POSIX.1 requires that local time zone information be used as though strftime called tzset. */ -# if HAVE_TZSET +# ifndef my_strftime if (!*tzset_called) { tzset (); diff --git a/m4/nstrftime.m4 b/m4/nstrftime.m4 index 6f2762a..e4eb87d 100644 --- a/m4/nstrftime.m4 +++ b/m4/nstrftime.m4 @@ -1,4 +1,4 @@ -# serial 35 +# serial 36 # Copyright (C) 1996-1997, 1999-2007, 2009-2020 Free Software Foundation, Inc. # @@ -17,8 +17,6 @@ AC_DEFUN([gl_FUNC_GNU_STRFTIME], AC_REQUIRE([gl_TM_GMTOFF]) - AC_CHECK_FUNCS_ONCE([tzset]) - AC_DEFINE([my_strftime], [nstrftime], [Define to the name of the strftime replacement function.]) ]) -- 2.7.4