new mktime.m4
authorTom Tromey <tromey@redhat.com>
Mon, 23 Mar 1998 17:11:16 +0000 (17:11 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 23 Mar 1998 17:11:16 +0000 (17:11 +0000)
ChangeLog
m4/mktime.m4

index ca61199..db5a4c2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 Mon Mar 23 07:55:04 1998  Tom Tromey  <tromey@cygnus.com>
 
+       * m4/mktime.m4: New version from Jim Meyering.
+
        * aclocal.in (usage): Document --print-ac-dir.
        (parse_arguments): Added --print-ac-dir.
 
index 8f9a8d9..ad937b7 100644 (file)
@@ -1,4 +1,4 @@
-#serial 3
+#serial 4
 
 dnl From Jim Meyering.
 dnl FIXME: this should migrate into libit.
@@ -23,6 +23,17 @@ changequote(<<, >>)dnl
 # endif
 #endif
 
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#if !HAVE_ALARM
+# define alarm(X) /* empty */
+#endif
+
+/* Work around redefinition to rpl_putenv by other config tests.  */
+#undef putenv
+
 static time_t time_t_max;
 
 /* Values we'll use to set the TZ environment variable.  */
@@ -45,6 +56,23 @@ mktime_test (now)
 }
 
 static void
+irix_6_4_bug ()
+{
+  /* Based on code from Ariel Faigon.  */
+  struct tm tm;
+  tm.tm_year = 96;
+  tm.tm_mon = 3;
+  tm.tm_mday = 0;
+  tm.tm_hour = 0;
+  tm.tm_min = 0;
+  tm.tm_sec = 0;
+  tm.tm_isdst = -1;
+  mktime (&tm);
+  if (tm.tm_mon != 2 || tm.tm_mday != 31)
+    exit (1);
+}
+
+static void
 bigtime_test (j)
      int j;
 {
@@ -98,6 +126,7 @@ main ()
         bigtime_test (j);
       bigtime_test (j - 1);
     }
+  irix_6_4_bug ();
   exit (0);
 }
              >>,