From: Bruno Haible Date: Thu, 6 Jun 2024 16:22:21 +0000 (+0200) Subject: parse-datetime: Support time zone names on MSVC. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=b53e7a0509f8a5ff65304b79fe7fbcfd5e49de64;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index 16b1ec8496..3e32b61642 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2024-06-06 Bruno Haible + + 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 time_rz: Support time zone names on MSVC. diff --git a/lib/parse-datetime.y b/lib/parse-datetime.y index 447a943db1..83e0ba38ce 100644 --- a/lib/parse-datetime.y +++ b/lib/parse-datetime.y @@ -1863,11 +1863,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++) { diff --git a/m4/parse-datetime.m4 b/m4/parse-datetime.m4 index 09e87e85d0..9932796231 100644 --- a/m4/parse-datetime.m4 +++ b/m4/parse-datetime.m4 @@ -1,5 +1,5 @@ # parse-datetime.m4 -# serial 27 +# 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, @@ -49,7 +49,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]) ]) diff --git a/modules/parse-datetime b/modules/parse-datetime index 1645660abe..64b3b09913 100644 --- a/modules/parse-datetime +++ b/modules/parse-datetime @@ -28,6 +28,7 @@ time-h time_r time_rz timegm +tzname configure.ac: gl_PARSE_DATETIME