From 5f04866f4c867e67b1c5573b86a7e20ef890e535 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 8 Mar 2010 01:45:46 +0100 Subject: time: Avoid #define replacements in C++ mode. --- m4/time_h.m4 | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'm4/time_h.m4') diff --git a/m4/time_h.m4 b/m4/time_h.m4 index c00bfae922..4bc266931d 100644 --- a/m4/time_h.m4 +++ b/m4/time_h.m4 @@ -23,18 +23,6 @@ AC_DEFUN([gl_HEADER_TIME_H_BODY], AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC]) ]) -AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS], -[ - dnl If another module says to replace or to not replace, do that. - dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK; - dnl this lets maintainers check for portability. - REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; AC_SUBST([REPLACE_LOCALTIME_R]) - REPLACE_MKTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_MKTIME]) - REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP]) - REPLACE_STRPTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_STRPTIME]) - REPLACE_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM]) -]) - dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared dnl in time.h or sys/time.h. @@ -72,3 +60,26 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC], AC_SUBST([TIME_H_DEFINES_STRUCT_TIMESPEC]) AC_SUBST([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC]) ]) + +AC_DEFUN([gl_TIME_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 +]) + +AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS], +[ + GNULIB_MKTIME=0; AC_SUBST([GNULIB_MKTIME]) + GNULIB_NANOSLEEP=0; AC_SUBST([GNULIB_NANOSLEEP]) + GNULIB_STRPTIME=0; AC_SUBST([GNULIB_STRPTIME]) + GNULIB_TIMEGM=0; AC_SUBST([GNULIB_TIMEGM]) + dnl If another module says to replace or to not replace, do that. + dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK; + dnl this lets maintainers check for portability. + REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; AC_SUBST([REPLACE_LOCALTIME_R]) + REPLACE_MKTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_MKTIME]) + REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP]) + REPLACE_STRPTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_STRPTIME]) + REPLACE_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM]) +]) -- cgit v1.2.1