]> Savannah Git Hosting - gnulib.git/commitdiff
nstrftime, c-nstrftime: Support time zone names on MSVC.
authorBruno Haible <bruno@clisp.org>
Thu, 6 Jun 2024 16:29:51 +0000 (18:29 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 6 Jun 2024 16:29:51 +0000 (18:29 +0200)
* lib/strftime.c: Use HAVE_TZNAME_ARRAY instead of HAVE_TZNAME.
(tzname): Remove declaration.
* modules/nstrftime (Depends-on): Add tzname.
* modules/c-nstrftime (Depends-on): Likewise.
* m4/nstrftime.m4 (gl_FUNC_GNU_STRFTIME): Don't require
AC_STRUCT_TIMEZONE.
* m4/c-nstrftime.m4 (gl_C_GNU_STRFTIME): Likewise.

ChangeLog
lib/strftime.c
m4/c-nstrftime.m4
m4/nstrftime.m4
modules/c-nstrftime
modules/nstrftime

index 3e32b6164222b29332401a58ea8d64d7b70e563b..b0fa4f8a4c118e606bea0c970e090a5ba7146e6f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2024-06-06  Bruno Haible  <bruno@clisp.org>
+
+       nstrftime, c-nstrftime: Support time zone names on MSVC.
+       * lib/strftime.c: Use HAVE_TZNAME_ARRAY instead of HAVE_TZNAME.
+       (tzname): Remove declaration.
+       * modules/nstrftime (Depends-on): Add tzname.
+       * modules/c-nstrftime (Depends-on): Likewise.
+       * m4/nstrftime.m4 (gl_FUNC_GNU_STRFTIME): Don't require
+       AC_STRUCT_TIMEZONE.
+       * m4/c-nstrftime.m4 (gl_C_GNU_STRFTIME): Likewise.
+
 2024-06-06  Bruno Haible  <bruno@clisp.org>
 
        parse-datetime: Support time zone names on MSVC.
index 3a429ed4afe7410039cb049d34598c3485dc0057..7d124e68f33efb902c9f5e2c62178a09665855e1 100644 (file)
@@ -27,7 +27,7 @@
 # define HAVE_STRUCT_ERA_ENTRY 1
 # define HAVE_TM_GMTOFF 1
 # define HAVE_STRUCT_TM_TM_ZONE 1
-# define HAVE_TZNAME 1
+# define HAVE_TZNAME_ARRAY 1
 # include "../locale/localeinfo.h"
 #else
 # include <libc-config.h>
 #include <errno.h>
 #include <time.h>
 
-#if HAVE_TZNAME && !HAVE_DECL_TZNAME
-extern char *tzname[];
-#endif
-
 /* Do multibyte processing if multibyte encodings are supported, unless
    multibyte sequences are safe in formats.  Multibyte sequences are
    safe if they cannot contain byte sequences that look like format
@@ -930,7 +926,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
 # define ampm (L_("AMPM") + 2 * (tp->tm_hour > 11))
 # define ap_len 2
 #endif
-#if HAVE_TZNAME
+#if HAVE_TZNAME_ARRAY
   char **tzname_vec = tzname;
 #endif
   const char *zone;
@@ -951,7 +947,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
      POSIX does not require it.  Do the right thing instead.  */
   zone = (const char *) tp->tm_zone;
 #endif
-#if HAVE_TZNAME
+#if HAVE_TZNAME_ARRAY
   if (!tz)
     {
       if (! (zone && *zone))
index f5cafbbcca5000c75b0b4775ae53a9c38f64560d..fbc18ce8c705b53fa04a7f225cd5cd4245700c4a 100644 (file)
@@ -1,5 +1,5 @@
 # c-nstrftime.m4
-# serial 1
+# serial 2
 dnl Copyright (C) 1996-2024 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -9,9 +9,6 @@ AC_DEFUN([gl_C_GNU_STRFTIME],
 [
   AC_REQUIRE([AC_C_RESTRICT])
 
-  # This defines (or not) HAVE_TZNAME and HAVE_STRUCT_TM_TM_ZONE.
-  AC_REQUIRE([AC_STRUCT_TIMEZONE])
-
   AC_REQUIRE([gl_TM_GMTOFF])
 
   dnl Test for strftime_l. It exists in
index f73bca40ec103821c5c5fa1e7adfff0a71363dbc..8c855c416361db2c7ea1cbd9497f88be44498474 100644 (file)
@@ -1,5 +1,5 @@
 # nstrftime.m4
-# serial 38
+# serial 39
 dnl Copyright (C) 1996-1997, 1999-2007, 2009-2024 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -11,8 +11,5 @@ AC_DEFUN([gl_FUNC_GNU_STRFTIME],
 [
  AC_REQUIRE([AC_C_RESTRICT])
 
- # This defines (or not) HAVE_TZNAME and HAVE_STRUCT_TM_TM_ZONE.
- AC_REQUIRE([AC_STRUCT_TIMEZONE])
-
  AC_REQUIRE([gl_TM_GMTOFF])
 ])
index 8b2348c22758447a37dc94343bd7da0b1017f872..fdd054c10e82793696091c6f06b8cc3b80624d28 100644 (file)
@@ -20,6 +20,7 @@ locale
 stdbool
 stdckdint
 time_rz
+tzname
 
 configure.ac:
 gl_C_GNU_STRFTIME
index 69b9d84605a19adff3921e9a81d70c77595dc297..35ed887a70fa9f38deb5804aebe1c989664f379c 100644 (file)
@@ -19,6 +19,7 @@ localename-unsafe-limited
 stdbool
 stdckdint
 time_rz
+tzname
 
 configure.ac:
 gl_FUNC_GNU_STRFTIME