Enforce that GETTIMEOFDAY_REPLACEMENT=0 is only expanded once.
authorBruno Haible <bruno@clisp.org>
Fri, 19 Jan 2007 02:04:14 +0000 (02:04 +0000)
committerBruno Haible <bruno@clisp.org>
Fri, 19 Jan 2007 02:04:14 +0000 (02:04 +0000)
ChangeLog
m4/sys_time_h.m4

index 6b66d4d..a7e05a0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2007-01-18  Bruno Haible  <bruno@clisp.org>
 
+       * m4/sys_time_h.m4 (gl_HEADER_SYS_TIME_H_BODY): Renamed from
+       gl_HEADER_SYS_TIME_H.
+       (gl_HEADER_SYS_TIME_H): New macro.
+
        * lib/sys_time_.h: Test GETTIMEOFDAY_REPLACEMENT instead of
        HAVE_GETTIMEOFDAY_POSIX_SIGNATURE and GETTIMEOFDAY_CLOBBERS_LOCALTIME.
        * m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY,
index 1943abf..dbd60c3 100644 (file)
@@ -9,6 +9,14 @@
 
 AC_DEFUN([gl_HEADER_SYS_TIME_H],
 [
+  dnl Use AC_REQUIRE here, so that the GETTIMEOFDAY_REPLACEMENT=0 statement
+  dnl below is expanded once only, before all GETTIMEOFDAY_REPLACEMENT=1
+  dnl statements that occur in other macros.
+  AC_REQUIRE([gl_HEADER_SYS_TIME_H_BODY])
+])
+
+AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY],
+[
   AC_REQUIRE([AC_C_RESTRICT])
   AC_CHECK_HEADERS_ONCE([sys/time.h])