Merge r21-4-11-chise-0_20-=ucs.
[chise/xemacs-chise.git.1] / lib-src / make-dump-id.c
index dba2a9c..bfa2f7d 100644 (file)
@@ -23,6 +23,26 @@ Boston, MA 02111-1307, USA.  */
 #include <stdlib.h>
 #include "../src/systime.h"
 
+#ifdef WIN32_NATIVE
+#include <sys/timeb.h>
+
+/* Emulate gettimeofday (Ulrich Leodolter, 1/11/95).  */
+void 
+gettimeofday (struct timeval *tv, struct timezone *tz)
+{
+  struct _timeb tb;
+  _ftime (&tb);
+
+  tv->tv_sec = tb.time;
+  tv->tv_usec = tb.millitm * 1000L;
+  if (tz) 
+    {
+      tz->tz_minuteswest = tb.timezone;        /* minutes west of Greenwich  */
+      tz->tz_dsttime = tb.dstflag;     /* type of dst correction  */
+    }
+}
+#endif
+
 /* Generates an (extremely) pseudo random number for the dump-id */
 static unsigned int
 generate_dump_id (void)
@@ -44,10 +64,7 @@ main (int argc, char *argv[])
       return EXIT_FAILURE;
     }
 
-  fprintf (f,
-          "#include <dump-id.h>\n"
-          "unsigned int dump_id = %uU;\n",
-          generate_dump_id ());
+  fprintf (f, "unsigned int dump_id = %uU;\n", generate_dump_id ());
 
   if ((fclose (f)) != 0)
     {