bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getdate on mingw: tzname problems


From: Paul Eggert
Subject: Re: getdate on mingw: tzname problems
Date: Tue, 15 Jan 2008 16:36:40 -0800
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Simon Josefsson <address@hidden> writes:

> Is there any platform where tzname isn't defined in time.h?

If memory serves, the C Standard doesn't allow <time.h> to define
tzname.  Both Solaris and glibc define tzname conditionally, and can
be compiled in pedantic mode.  I don't know whether it comes up in
practical builds, but it should be easy to do it "right".  I installed
this:

2008-01-15  Paul Eggert  <address@hidden>

        Fix problem with getdate on mingw32 reported by Simon Josefsson
        in <http://lists.gnu.org/archive/html/bug-gnulib/2008-01/msg00192.html>.
        * lib/getdate.y (get_date): Check "HAVE_DECL_TZNAME", not "defined
        tzname", when deciding whether to declare tzname.
        * lib/strftime.c (tzname): Likewise.

diff --git a/lib/getdate.y b/lib/getdate.y
index 1ed914f..1deec51 100644
--- a/lib/getdate.y
+++ b/lib/getdate.y
@@ -1321,7 +1321,7 @@ get_date (struct timespec *result, char const *p, struct 
timespec const *now)
 #else
 #if HAVE_TZNAME
   {
-# ifndef tzname
+# if !HAVE_DECL_TZNAME
     extern char *tzname[];
 # endif
     int i;
diff --git a/lib/strftime.c b/lib/strftime.c
index c6a9c80..897aab7 100644
--- a/lib/strftime.c
+++ b/lib/strftime.c
@@ -37,7 +37,7 @@
 #include <ctype.h>
 #include <time.h>

-#if HAVE_TZNAME && ! defined tzname
+#if HAVE_TZNAME && !HAVE_DECL_TZNAME
 extern char *tzname[];
 #endif





reply via email to

[Prev in Thread] Current Thread [Next in Thread]