]> Savannah Git Hosting - gnulib.git/commitdiff
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 23:40:23 +0000 (01:40 +0200)
* lib/nstrftime.c: Use HAVE_TZNAME_ARRAY instead of HAVE_TZNAME.
(tzname): Remove declaration.
* modules/nstrftime (Depends-on): Add tzname.
* m4/nstrftime.m4 (gl_FUNC_GNU_STRFTIME): Don't require
AC_STRUCT_TIMEZONE.

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

index c315f4d08ca4ed406641057fc074e9978a9d40e1..9fafd39f693f8abee6de2183ee52d62f20277027 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-06-06  Bruno Haible  <bruno@clisp.org>
+
+       nstrftime: Support time zone names on MSVC.
+       * lib/nstrftime.c: Use HAVE_TZNAME_ARRAY instead of HAVE_TZNAME.
+       (tzname): Remove declaration.
+       * modules/nstrftime (Depends-on): Add tzname.
+       * m4/nstrftime.m4 (gl_FUNC_GNU_STRFTIME): Don't require
+       AC_STRUCT_TIMEZONE.
+
 2024-06-06  Bruno Haible  <bruno@clisp.org>
 
        parse-datetime: Support time zone names on MSVC.
index bb0ac99cb2b95ae124dafb9fae18376590b7c422..f3c537aa443e4c139dbea0bafbacc9c8d8085396 100644 (file)
@@ -19,7 +19,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
@@ -483,7 +479,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
 # define aam_len STRLEN (a_altmonth)
 # define ap_len STRLEN (ampm)
 #endif
-#if HAVE_TZNAME
+#if HAVE_TZNAME_ARRAY
   char **tzname_vec = tzname;
 #endif
   const char *zone;
@@ -504,7 +500,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 04c0b63fbd0384df51b09de0a7a1695e2f05ad14..f9367bccf7ad101856083fd083adbf447724b3f9 100644 (file)
@@ -1,6 +1,6 @@
-# serial 37
+# serial 37.1
 
-# Copyright (C) 1996-1997, 1999-2007, 2009-2023 Free Software Foundation, Inc.
+# Copyright (C) 1996-1997, 1999-2007, 2009-2024 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -12,9 +12,6 @@ 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])
 
  AC_DEFINE([my_strftime], [nstrftime],
index 35945575b8f9ad33d09dc54ea058919c9112439d..a8f74d12cf372a8b176a1298c027a30c039a585c 100644 (file)
@@ -18,6 +18,7 @@ libc-config
 stdbool
 stdckdint
 time_rz
+tzname
 
 configure.ac:
 gl_FUNC_GNU_STRFTIME