]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
AC_STRUCT_TIMEZONE now defines HAVE_DECL_TZNAME if it is declared,
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 28 Mar 2004 21:51:10 +0000 (21:51 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 28 Mar 2004 21:51:10 +0000 (21:51 +0000)
when HAVE_STRUCT_TM_TM_ZONE is not defined.

ChangeLog
doc/autoconf.texi
lib/autoconf/types.m4

index cbd23975c07da6121a7acfcf0772835af0e5b76a..3120c9bd4d3054eaefb3d2bf6cc1a6b726556aee 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2004-03-28  Paul Eggert  <eggert@twinsun.com>
+
+       * 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.
+
 2004-03-28  Steven G. Johnson  <stevenj@fftw.org>
 
        * lib/autoconf/fortran.m4 (_AC_PROG_FC_V_OUTPUT): Corrected
index 7d835e7893de3b4968fdd65a1e5a22bfee7133e0..6426ddf4008e7a90f674679e008833dbadec5bea 100644 (file)
@@ -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
-@code{tzname} is found, define @code{HAVE_TZNAME}.
+@code{tzname} is found, define @code{HAVE_TZNAME}; if it is declared,
+define @code{HAVE_DECL_TZNAME}.
 @end defmac
 
 @node Generic Structures
index 450f6e488ff421a48df21ea5b1dbafbf558968ad..9c265c829f70a7237e6ad10ad3748cabc0c95463 100644 (file)
@@ -614,14 +614,15 @@ if test "$ac_cv_member_struct_tm_tm_zone" = yes; then
            [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