+2010-04-03 Bruno Haible <bruno@clisp.org>
+
+ timegm: Fix C++ test error on mingw.
+ * lib/time.in.h (timegm): Use modern idiom.
+ * m4/timegm.m4 (gl_FUNC_TIMEGM): When timegm does not exist, set
+ HAVE_TIMEGM to 0, not REPLACE_TIMEGM to 1.
+ * m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Initialize HAVE_TIMEGM.
+ * modules/time (Makefile.am): Substitute HAVE_TIMEGM.
+
2010-04-03 Bruno Haible <bruno@clisp.org>
timegm: Assume declaration if function exists.
_GL_FUNCDECL_RPL (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (timegm, time_t, (struct tm *__tm));
# else
+# if ! @HAVE_TIMEGM@
+_GL_FUNCDECL_SYS (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1)));
+# endif
_GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm));
# endif
_GL_CXXALIASWARN (timegm);
GNULIB_TIME_R=0; AC_SUBST([GNULIB_TIME_R])
dnl Assume proper GNU behavior unless another module says otherwise.
HAVE_LOCALTIME_R=0; AC_SUBST([HAVE_LOCALTIME_R])
+ HAVE_TIMEGM=0; AC_SUBST([HAVE_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.
-# timegm.m4 serial 7
+# timegm.m4 serial 8
dnl Copyright (C) 2003, 2007, 2009, 2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
AC_REQUIRE([gl_FUNC_MKTIME])
REPLACE_TIMEGM=0
- if test $ac_cv_func_working_mktime = no; then
- # Assume that timegm is buggy if mktime is.
- REPLACE_TIMEGM=1
- else
- AC_CHECK_FUNCS([timegm])
- if test $ac_cv_func_timegm != yes; then
+ AC_CHECK_FUNCS_ONCE([timegm])
+ if test $ac_cv_func_timegm = yes; then
+ if test $ac_cv_func_working_mktime = no; then
+ # Assume that timegm is buggy if mktime is.
REPLACE_TIMEGM=1
fi
+ else
+ HAVE_TIMEGM=0
fi
- if test $REPLACE_TIMEGM = 1; then
+ if test $HAVE_TIMEGM = 0 || test $REPLACE_TIMEGM = 1; then
AC_LIBOBJ([timegm])
gl_PREREQ_TIMEGM
fi
-e 's|@''GNULIB_TIMEGM''@|$(GNULIB_TIMEGM)|g' \
-e 's|@''GNULIB_TIME_R''@|$(GNULIB_TIME_R)|g' \
-e 's|@''HAVE_LOCALTIME_R''@|$(HAVE_LOCALTIME_R)|g' \
+ -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \
-e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \
-e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \
-e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \