1 dnl Reentrant time functions like localtime_r.
3 dnl Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
5 dnl This file is free software; the Free Software Foundation
6 dnl gives unlimited permission to copy and/or distribute it,
7 dnl with or without modifications, as long as this notice is preserved.
9 dnl Written by Paul Eggert.
13 dnl Persuade glibc and Solaris <time.h> to declare localtime_r.
14 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
16 AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
17 AC_REQUIRE([AC_C_RESTRICT])
19 AC_CACHE_CHECK([whether localtime_r is compatible with its POSIX signature],
21 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
22 [[#include <time.h>]],
23 [[/* We don't need to append 'restrict's to the argument types,
24 even though the POSIX signature has the 'restrict's,
25 since C99 says they can't affect type compatibility. */
26 struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r;
28 /* Check the return type is a pointer. On HP-UX 10 it is 'int'. */
29 *localtime_r (0, 0);]])],
30 [gl_cv_time_r_posix=yes],
31 [gl_cv_time_r_posix=no])])
32 if test $gl_cv_time_r_posix = yes; then
41 # Prerequisites of lib/time_r.c.
42 AC_DEFUN([gl_PREREQ_TIME_R], [