]> Savannah Git Hosting - gnulib.git/commitdiff
parse-datetime: Support time zone names on MSVC.
authorBruno Haible <bruno@clisp.org>
Thu, 6 Jun 2024 16:22:21 +0000 (18:22 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 6 Jun 2024 23:40:18 +0000 (01:40 +0200)
* lib/parse-datetime.y (parse_datetime_body): Use HAVE_TZNAME_ARRAY
instead of HAVE_TZNAME. Don't declare tzname.
* modules/parse-datetime (Depends-on): Add tzname.
* m4/parse-datetime.m4 (gl_PARSE_DATETIME): Don't invoke
AC_STRUCT_TIMEZONE.

ChangeLog
lib/parse-datetime.y
m4/parse-datetime.m4
modules/parse-datetime

index 308bec6bc75f0075dd1220b1f48b22044314fe36..c315f4d08ca4ed406641057fc074e9978a9d40e1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-06-06  Bruno Haible  <bruno@clisp.org>
+
+       parse-datetime: Support time zone names on MSVC.
+       * lib/parse-datetime.y (parse_datetime_body): Use HAVE_TZNAME_ARRAY
+       instead of HAVE_TZNAME. Don't declare tzname.
+       * modules/parse-datetime (Depends-on): Add tzname.
+       * m4/parse-datetime.m4 (gl_PARSE_DATETIME): Don't invoke
+       AC_STRUCT_TIMEZONE.
+
 2024-06-06  Bruno Haible  <bruno@clisp.org>
 
        time_rz: Support time zone names on MSVC.
index f926f4d84c3d480001545e9b59ebee7d90485de5..a3516d0bccbc4e73f870f182956b90f07b8ed3fc 100644 (file)
@@ -1,7 +1,7 @@
 %{
 /* Parse a string into an internal timestamp.
 
-   Copyright (C) 1999-2000, 2002-2023 Free Software Foundation, Inc.
+   Copyright (C) 1999-2000, 2002-2024 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -1864,11 +1864,8 @@ parse_datetime_body (struct timespec *result, char const *p,
       }
   }
 #else
-#if HAVE_TZNAME
+#if HAVE_TZNAME_ARRAY
   {
-# if !HAVE_DECL_TZNAME
-    extern char *tzname[];
-# endif
     int i;
     for (i = 0; i < 2; i++)
       {
index 7876b4118f00de0f0c3805a663dbcbdfafe5a449..2ef502b7db817cbdc098e6e79793142d4d1964e9 100644 (file)
@@ -1,5 +1,5 @@
-# parse-datetime.m4 serial 27
-dnl Copyright (C) 2002-2006, 2008-2023 Free Software Foundation, Inc.
+# parse-datetime.m4 serial 28
+dnl Copyright (C) 2002-2006, 2008-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,
 dnl with or without modifications, as long as this notice is preserved.
@@ -48,7 +48,6 @@ AC_DEFUN([gl_PARSE_DATETIME],
   dnl Prerequisites of lib/parse-datetime.y.
   AC_REQUIRE([gl_BISON])
   AC_REQUIRE([gl_C_COMPOUND_LITERALS])
-  AC_STRUCT_TIMEZONE
   AC_REQUIRE([gl_CLOCK_TIME])
   AC_REQUIRE([gl_TM_GMTOFF])
 ])
index 60ac0b082478199663620512e2f16676d9e27c5c..8590f0b2a902de5097ca7207a75831ad2c2fe493 100644 (file)
@@ -28,6 +28,7 @@ time-h
 time_r
 time_rz
 timegm
+tzname
 
 configure.ac:
 gl_PARSE_DATETIME