[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AC_STRUCT_TIMEZONE tzname on mingw
From: |
Paul Eggert |
Subject: |
Re: AC_STRUCT_TIMEZONE tzname on mingw |
Date: |
Sun, 28 Mar 2004 13:51:53 -0800 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
Kevin Ryde <address@hidden> writes:
> As you say, HAVE_DECL_TZNAME would surely be the right thing for the
> latter.
OK, I installed this patch.
2004-03-28 Paul Eggert <address@hidden>
* doc/autoconf.texi (Particular Structures): AC_STRUCT_TIMEZONE
now defines HAVE_DECL_TZNAME if it is declared, when
HAVE_STRUCT_TM_TM_ZONE is not defined.
* lib/autoconf/types.m4 (AC_STRUCT_TIMEZONE): Implement this.
Do not assume atoi. Rely on HAVE_DECL_TZNAME when testing
for HAVE_TZNAME.
Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.806
diff -p -u -r1.806 autoconf.texi
--- doc/autoconf.texi 24 Mar 2004 22:40:15 -0000 1.806
+++ doc/autoconf.texi 28 Mar 2004 21:47:26 -0000
@@ -5094,7 +5094,8 @@ had better define @code{struct tm}.
Figure out how to get the current timezone. If @code{struct tm} has a
@code{tm_zone} member, define @code{HAVE_STRUCT_TM_TM_ZONE} (and the
obsoleted @code{HAVE_TM_ZONE}). Otherwise, if the external array
address@hidden is found, define @code{HAVE_TZNAME}.
address@hidden is found, define @code{HAVE_TZNAME}; if it is declared,
+define @code{HAVE_DECL_TZNAME}.
@end defmac
@node Generic Structures
Index: lib/autoconf/types.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/types.m4,v
retrieving revision 1.26
diff -p -u -r1.26 types.m4
--- lib/autoconf/types.m4 15 Mar 2004 22:00:06 -0000 1.26
+++ lib/autoconf/types.m4 28 Mar 2004 21:47:27 -0000
@@ -614,14 +614,15 @@ if test "$ac_cv_member_struct_tm_tm_zone
[Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use
`HAVE_STRUCT_TM_TM_ZONE' instead.])
else
+ AC_CHECK_DECLS([tzname], , , [#include <time.h>])
AC_CACHE_CHECK(for tzname, ac_cv_var_tzname,
[AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <time.h>
-#ifndef tzname /* For SGI. */
-extern char *tzname[]; /* RS6000 and others reject char **tzname. */
+#if !HAVE_DECL_TZNAME
+extern char *tzname[];
#endif
]],
-[atoi(*tzname);])],
+[[return tzname[0][0];]])],
[ac_cv_var_tzname=yes],
[ac_cv_var_tzname=no])])
if test $ac_cv_var_tzname = yes; then