Paul Eggert | 22 Jun 2012 17:44
Favicon

[PATCH] time_r: fix typo that always overrode localtime_r decl

 ChangeLog    |    7 +++++++
 m4/time_r.m4 |    2 +-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a12bccf..74354d5 100644
--- a/ChangeLog
+++ b/ChangeLog
 <at>  <at>  -1,3 +1,10  <at>  <at> 
+2012-06-22  Paul Eggert  <eggert <at> cs.ucla.edu>
+
+	time_r: fix typo that always overrode localtime_r decl
+	* m4/time_r.m4 (gl_TIME_R): Use AC_CHECK_DECLS, not
+	AC_CHECK_DECLS_ONCE, since localtime_r is declared in <time.h>,
+	not in a standard include.
+
 2012-06-22  Bruno Haible  <bruno <at> clisp.org>

 	Write "Mac OS X" instead of "MacOS X".
diff --git a/m4/time_r.m4 b/m4/time_r.m4
index c3579fb..9ddbd01 100644
--- a/m4/time_r.m4
+++ b/m4/time_r.m4
 <at>  <at>  -17,7 +17,7  <at>  <at>  AC_DEFUN([gl_TIME_R],

   dnl Some systems don't declare localtime_r() and gmtime_r() if _REENTRANT is
   dnl not defined.
-  AC_CHECK_DECLS_ONCE([localtime_r])
+  AC_CHECK_DECLS([localtime_r], [], [], [[#include <time.h>]])
   if test $ac_cv_have_decl_localtime_r = no; then
(Continue reading)

Bruno Haible | 22 Jun 2012 18:46

Re: [PATCH] time_r: fix typo that always overrode localtime_r decl

Paul Eggert wrote:
> +	time_r: fix typo that always overrode localtime_r decl

The mistake was mine, sorry.

But the effect was harmless: gnulib's <time.h> was merely providing a
redundant declaration. Also, not all platforms were affected:
In past build logs, I can see

  checking whether localtime_r is declared... no

for glibc, Mac OS X, Minix, AIX, HP-UX 11.00, OSF/1, and

  checking whether localtime_r is declared... yes

for FreeBSD, NetBSD, OpenBSD, HP-UX 11.31, IRIX, Solaris 9..11, Cygwin;
on these latter platforms we were lucky.

Bruno


Gmane