source: trunk/essentials/app-arch/tar/m4/time_r.m4

Last change on this file was 3342, checked in by bird, 18 years ago

tar 1.16.1

File size: 1.2 KB
Line 
1dnl Reentrant time functions like localtime_r.
2
3dnl Copyright (C) 2003, 2006 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl Written by Paul Eggert.
9
10AC_DEFUN([gl_TIME_R],
11[
12 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
13 AC_REQUIRE([AC_C_RESTRICT])
14
15 AC_CACHE_CHECK([whether localtime_r is compatible with its POSIX signature],
16 [gl_cv_time_r_posix],
17 [AC_TRY_COMPILE(
18 [#include <time.h>],
19 [/* We don't need to append 'restrict's to the argument types,
20 even though the POSIX signature has the 'restrict's,
21 since C99 says they can't affect type compatibility. */
22 struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r;
23 if (ptr) return 0;],
24 [gl_cv_time_r_posix=yes],
25 [gl_cv_time_r_posix=no])])
26 if test $gl_cv_time_r_posix = yes; then
27 AC_DEFINE([HAVE_TIME_R_POSIX], 1,
28 [Define to 1 if localtime_r, etc. have the type signatures that
29 POSIX requires.])
30 else
31 AC_LIBOBJ([time_r])
32 gl_PREREQ_TIME_R
33 fi
34])
35
36# Prerequisites of lib/time_r.c.
37AC_DEFUN([gl_PREREQ_TIME_R], [
38 :
39])
Note: See TracBrowser for help on using the repository browser.