time: Undefine more broken macros.
authorBruno Haible <bruno@clisp.org>
Thu, 3 Jun 2010 14:25:01 +0000 (16:25 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 3 Jun 2010 14:25:01 +0000 (16:25 +0200)
ChangeLog
lib/time.in.h

index 93e04f9..84fdd90 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2010-06-03  Bruno Haible  <bruno@clisp.org>
 
+       time: Undefine more broken macros.
+       * lib/time.in.h: Undefine broken localtime_r and gmtime_r macros only
+       for pthread-win32. Undefine also asctime_r, ctime_r, rand_r, strtok_r.
+       Reported by Eric Blake.
+
+2010-06-03  Bruno Haible  <bruno@clisp.org>
+
        Choose among AC_DEFUN_ONCE, AC_DEFUN in a way that aclocal understands.
        * m4/iconv.m4 (gl_iconv_AC_DEFUN): New macro.
        (AM_ICONV): Define it through gl_iconv_AC_DEFUN.
index 6d2b818..87608a3 100644 (file)
 #   include <sys/time.h>
 #  elif @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 #   include <pthread.h>
+/* The pthreads-win32 <pthread.h> also defines a couple of broken macros.  */
+#   undef asctime_r
+#   undef ctime_r
+#   undef gmtime_r
+#   undef localtime_r
+#   undef rand_r
+#   undef strtok_r
 #  else
 
 #   ifdef __cplusplus
@@ -131,7 +138,6 @@ _GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
                                              struct tm *restrict __result));
 #  else
 #   if ! @HAVE_LOCALTIME_R@
-#    undef localtime_r
 _GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
                                              struct tm *restrict __result)
                                             _GL_ARG_NONNULL ((1, 2)));
@@ -152,7 +158,6 @@ _GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
                                           struct tm *restrict __result));
 #  else
 #   if ! @HAVE_LOCALTIME_R@
-#    undef gmtime_r
 _GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
                                           struct tm *restrict __result)
                                          _GL_ARG_NONNULL ((1, 2)));