]> Savannah Git Hosting - gnulib.git/commitdiff
nstrftime, time_rz: Avoid using an obsolete Autoconf macro.
authorBruno Haible <bruno@clisp.org>
Mon, 4 Jan 2021 21:39:23 +0000 (22:39 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 4 Jan 2021 21:40:43 +0000 (22:40 +0100)
Reported by Mike Gran <spk121@yahoo.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-01/msg00067.html>.

* lib/time-internal.h: Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
* lib/time_rz.c: Likewise.
* lib/nstrftime.c: Set and test HAVE_STRUCT_TM_TM_ZONE, not
HAVE_TM_ZONE.
* m4/nstrftime.m4 (gl_FUNC_GNU_STRFTIME): Update comments.

ChangeLog
lib/nstrftime.c
lib/time-internal.h
lib/time_rz.c
m4/nstrftime.m4

index 0add7d2679051d61f9a494e617a92674c247c01f..c86fb7888209718fb9d7e057328de1027b785525 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2021-01-04  Bruno Haible  <bruno@clisp.org>
+
+       nstrftime, time_rz: Avoid using an obsolete Autoconf macro.
+       Reported by Mike Gran <spk121@yahoo.com> in
+       <https://lists.gnu.org/archive/html/bug-gnulib/2021-01/msg00067.html>.
+       * lib/time-internal.h: Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
+       * lib/time_rz.c: Likewise.
+       * lib/nstrftime.c: Set and test HAVE_STRUCT_TM_TM_ZONE, not
+       HAVE_TM_ZONE.
+       * m4/nstrftime.m4 (gl_FUNC_GNU_STRFTIME): Update comments.
+
 2021-01-04  Bruno Haible  <bruno@clisp.org>
 
        expm1f-ieee: Work around AIX 7.2 bug.
index 252256a593e5d2c3123d09693bc612e08c16f22a..7ef75290bcc2bb1d5980b88b685358c06c6b07fb 100644 (file)
@@ -19,7 +19,7 @@
 # define USE_IN_EXTENDED_LOCALE_MODEL 1
 # define HAVE_STRUCT_ERA_ENTRY 1
 # define HAVE_TM_GMTOFF 1
-# define HAVE_TM_ZONE 1
+# define HAVE_STRUCT_TM_TM_ZONE 1
 # define HAVE_TZNAME 1
 # include "../locale/localeinfo.h"
 #else
@@ -499,7 +499,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
 #endif
 
   zone = NULL;
-#if HAVE_TM_ZONE
+#if HAVE_STRUCT_TM_TM_ZONE
   /* The POSIX test suite assumes that setting
      the environment variable TZ to a new value before calling strftime()
      will influence the result (the %Z format) even if the information in
@@ -516,7 +516,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
     }
   else
     {
-# if !HAVE_TM_ZONE
+# if !HAVE_STRUCT_TM_TM_ZONE
       /* Infer the zone name from *TZ instead of from TZNAME.  */
       tzname_vec = tz->tzname_copy;
 # endif
index 90364a029490fe902fcd14db6be2c40a02b95ade..fb9b5ed00cc9896b39ff18763da80332b1c28fe6 100644 (file)
@@ -24,7 +24,7 @@ struct tm_zone
      members are zero.  */
   struct tm_zone *next;
 
-#if HAVE_TZNAME && !HAVE_TM_ZONE
+#if HAVE_TZNAME && !HAVE_STRUCT_TM_TM_ZONE
   /* Copies of recent strings taken from tzname[0] and tzname[1].
      The copies are in ABBRS, so that they survive tzset.  Null if unknown.  */
   char *tzname_copy[2];
index 0fdff80200ff67f2e8bfbfd64428a9a1d1562620..c388019478b7500f897a0e4380b851c99cff9fde 100644 (file)
@@ -71,7 +71,7 @@ tzalloc (char const *name)
   if (tz)
     {
       tz->next = NULL;
-#if HAVE_TZNAME && !HAVE_TM_ZONE
+#if HAVE_TZNAME && !HAVE_STRUCT_TM_TM_ZONE
       tz->tzname_copy[0] = tz->tzname_copy[1] = NULL;
 #endif
       tz->tz_is_set = !!name;
@@ -83,13 +83,13 @@ tzalloc (char const *name)
 }
 
 /* Save into TZ any nontrivial time zone abbreviation used by TM, and
-   update *TM (if HAVE_TM_ZONE) or *TZ (if !HAVE_TM_ZONE &&
-   HAVE_TZNAME) if they use the abbreviation.  Return true if
-   successful, false (setting errno) otherwise.  */
+   update *TM (if HAVE_STRUCT_TM_TM_ZONE) or *TZ (if
+   !HAVE_STRUCT_TM_TM_ZONE && HAVE_TZNAME) if they use the abbreviation.
+   Return true if successful, false (setting errno) otherwise.  */
 static bool
 save_abbr (timezone_t tz, struct tm *tm)
 {
-#if HAVE_TM_ZONE || HAVE_TZNAME
+#if HAVE_STRUCT_TM_TM_ZONE || HAVE_TZNAME
   char const *zone = NULL;
   char *zone_copy = (char *) "";
 
@@ -97,7 +97,7 @@ save_abbr (timezone_t tz, struct tm *tm)
   int tzname_index = -1;
 # endif
 
-# if HAVE_TM_ZONE
+# if HAVE_STRUCT_TM_TM_ZONE
   zone = tm->tm_zone;
 # endif
 
@@ -145,7 +145,7 @@ save_abbr (timezone_t tz, struct tm *tm)
     }
 
   /* Replace the zone name so that its lifetime matches that of TZ.  */
-# if HAVE_TM_ZONE
+# if HAVE_STRUCT_TM_TM_ZONE
   tm->tm_zone = zone_copy;
 # else
   if (0 <= tzname_index)
@@ -303,7 +303,7 @@ mktime_z (timezone_t tz, struct tm *tm)
           tm_1.tm_isdst = tm->tm_isdst;
           time_t t = mktime (&tm_1);
           bool ok = 0 <= tm_1.tm_yday;
-#if HAVE_TM_ZONE || HAVE_TZNAME
+#if HAVE_STRUCT_TM_TM_ZONE || HAVE_TZNAME
           ok = ok && save_abbr (tz, &tm_1);
 #endif
           if (revert_tz (old_tz) && ok)
index 4674442810be8a5d22bd11602159ef3b45dbe58e..b510554b947a7d453744acb16c12fe99f63517df 100644 (file)
@@ -1,4 +1,4 @@
-# serial 36
+# serial 37
 
 # Copyright (C) 1996-1997, 1999-2007, 2009-2021 Free Software Foundation, Inc.
 #
@@ -12,7 +12,7 @@ AC_DEFUN([gl_FUNC_GNU_STRFTIME],
 [
  AC_REQUIRE([AC_C_RESTRICT])
 
- # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE.
+ # This defines (or not) HAVE_TZNAME and HAVE_STRUCT_TM_TM_ZONE.
  AC_REQUIRE([AC_STRUCT_TIMEZONE])
 
  AC_REQUIRE([gl_TM_GMTOFF])