summaryrefslogtreecommitdiff
path: root/m4/time_r.m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2010-12-31 14:01:33 +0100
committerBruno Haible <bruno@clisp.org>2010-12-31 14:01:33 +0100
commit115dcb2a1ade67d78b430081e225f46aad742e7b (patch)
tree08974292a3fd8a53a3d2112dd6dfe0b9f0e4ee6f /m4/time_r.m4
parent57505a676083a77cf44f683f65281c7fff5bf6fb (diff)
downloadgnulib-115dcb2a1ade67d78b430081e225f46aad742e7b.tar.gz
time_r: Add missing declarations on HP-UX 11.
* lib/time.in.h (localtime_r, gmtime_r): Test HAVE_DECL_LOCALTIME_R instead of HAVE_LOCALTIME_R. * m4/time_r.m4 (gl_TIME_R): Test whether localtime_r is declared. Set HAVE_LOCALTIME_R always. * m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Initialize HAVE_DECL_LOCALTIME_R, not HAVE_LOCALTIME_R. * modules/time (Makefile.am): Substitute HAVE_DECL_LOCALTIME_R, not HAVE_LOCALTIME_R. * doc/posix-functions/gmtime_r.texi: Document the HP-UX 11 problem. * doc/posix-functions/localtime_r.texi: Likewise.
Diffstat (limited to 'm4/time_r.m4')
-rw-r--r--m4/time_r.m48
1 files changed, 8 insertions, 0 deletions
diff --git a/m4/time_r.m4 b/m4/time_r.m4
index 9e82d39ffb..f9bed0c5c8 100644
--- a/m4/time_r.m4
+++ b/m4/time_r.m4
@@ -15,8 +15,16 @@ AC_DEFUN([gl_TIME_R],
AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
AC_REQUIRE([AC_C_RESTRICT])
+ dnl Some systems don't declare localtime_r() and gmtime_r() if _REENTRANT is
+ dnl not defined.
+ AC_CHECK_DECLS_ONCE([localtime_r])
+ if test $ac_cv_have_decl_localtime_r = no; then
+ HAVE_DECL_LOCALTIME_R=0
+ fi
+
AC_CHECK_FUNCS_ONCE([localtime_r])
if test $ac_cv_func_localtime_r = yes; then
+ HAVE_LOCALTIME_R=1
AC_CACHE_CHECK([whether localtime_r is compatible with its POSIX signature],
[gl_cv_time_r_posix],
[AC_COMPILE_IFELSE(