trying to fix #71457 for timing precision when gettimeofday() is not

* configure.in xmllint.c: trying to fix #71457 for timing
  precision when gettimeofday() is not availble but ftime() is
Daniel
diff --git a/ChangeLog b/ChangeLog
index a1e6a59..1ef5d25 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Mar  7 12:19:36 CET 2002 Daniel Veillard <daniel@veillard.com>
+
+	* configure.in xmllint.c: trying to fix #71457 for timing
+	  precision when gettimeofday() is not availble but ftime() is
+
 Thu Mar  7 11:24:02 CET 2002 Daniel Veillard <daniel@veillard.com>
 
 	* libxml.spec.in doc/Makefile.am: Fixed #73408 missing images
diff --git a/configure.in b/configure.in
index 2319c2c..0c12048 100644
--- a/configure.in
+++ b/configure.in
@@ -87,7 +87,7 @@
 AC_CHECK_HEADERS(ieeefp.h nan.h math.h fp_class.h float.h)
 AC_CHECK_HEADERS(stdlib.h sys/socket.h netinet/in.h arpa/inet.h)
 AC_CHECK_HEADERS(netdb.h sys/time.h sys/select.h sys/mman.h)
-AC_CHECK_HEADERS(signal.h)
+AC_CHECK_HEADERS(sys/timeb.h signal.h)
 
 dnl Specific dir for HTML output ?
 if test "x$with_html_dir" = "x" ; then
@@ -102,7 +102,7 @@
 AC_FUNC_STRFTIME
 AC_CHECK_FUNCS(strdup strndup strerror)
 AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
-AC_CHECK_FUNCS(strftime localtime)
+AC_CHECK_FUNCS(strftime localtime ftime)
 AC_CHECK_FUNCS(stat _stat signal)
 
 dnl Checking the standard string functions availability
diff --git a/xmllint.c b/xmllint.c
index 4c0ebe1..eed22b0 100644
--- a/xmllint.c
+++ b/xmllint.c
@@ -129,6 +129,31 @@
  * function calls
  */
 
+#ifndef HAVE_GETTIMEOFDAY 
+#ifdef HAVE_SYS_TIMEB_H
+#ifdef HAVE_SYS_TIME_H
+#ifdef HAVE_FTIME
+
+int
+my_gettimeofday(struct timeval *tvp, void *tzp)
+{
+	struct timeb timebuffer;
+
+	ftime(&timebuffer);
+	if (tvp) {
+		tvp->tv_sec = timebuffer.time;
+		tvp->tv_usec = timebuffer.millitm * 1000L;
+	}
+	return (0);
+}
+#define HAVE_GETTIMEOFDAY 1
+#define gettimeofday my_gettimeofday
+
+#endif /* HAVE_FTIME */
+#endif /* HAVE_SYS_TIME_H */
+#endif /* HAVE_SYS_TIMEB_H */
+#endif /* !HAVE_GETTIMEOFDAY */
+
 #if defined(HAVE_GETTIMEOFDAY)
 static struct timeval begin, end;