diff --git a/ChangeLog b/ChangeLog index 450765d3..742c2a17 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Mar 7 15:17:21 CET 2002 Daniel Veillard + + * configure.in xsltproc/xsltproc.c: fixed bug #71488 in a + similar way as #71457 + Thu Mar 7 09:41:59 CET 2002 Daniel Veillard * tests/xmlspec/REC-xml-20001006*.html tests/XSLTMark/xslbench1.out: diff --git a/config.h.in b/config.h.in index ce889f73..c9452264 100644 --- a/config.h.in +++ b/config.h.in @@ -16,6 +16,9 @@ /* Define if you have the asctime function. */ #undef HAVE_ASCTIME +/* Define if you have the ftime function. */ +#undef HAVE_FTIME + /* Define if you have the gettimeofday function. */ #undef HAVE_GETTIMEOFDAY @@ -70,6 +73,9 @@ /* Define if you have the header file. */ #undef HAVE_SYS_TIME_H +/* Define if you have the header file. */ +#undef HAVE_SYS_TIMEB_H + /* Define if you have the header file. */ #undef HAVE_SYS_TYPES_H diff --git a/configure.in b/configure.in index 62a72ceb..5f7f93bc 100644 --- a/configure.in +++ b/configure.in @@ -102,9 +102,8 @@ dnl AC_CHECK_HEADERS(sys/types.h sys/time.h stdlib.h unistd.h string.h) AC_CHECK_HEADERS(ieeefp.h nan.h math.h fp_class.h float.h ansidecl.h) -AC_CHECK_HEADERS(time.h sys/stat.h stdarg.h) +AC_CHECK_HEADERS(sys/timeb.h time.h sys/stat.h stdarg.h) AC_CHECK_FUNCS(stat _stat) - AC_CHECK_FUNC(isnan, , AC_CHECK_LIB(m, isnan, [M_LIBS="-lm"; AC_DEFINE(HAVE_ISNAN)])) @@ -120,7 +119,7 @@ AC_CHECK_FUNC(floor, , AC_CHECK_LIB(m, floor, AC_CHECK_FUNC(fabs, , AC_CHECK_LIB(m, fabs, [M_LIBS="-lm"; AC_DEFINE(HAVE_FABS)])) AC_CHECK_FUNCS(gettimeofday) -AC_CHECK_FUNCS(mktime localtime asctime time gmtime) +AC_CHECK_FUNCS(mktime localtime asctime time gmtime ftime) dnl dnl Perl is just needed for generating some data for XSLtmark diff --git a/xsltproc/xsltproc.c b/xsltproc/xsltproc.c index 798cf8c4..23660b1f 100644 --- a/xsltproc/xsltproc.c +++ b/xsltproc/xsltproc.c @@ -14,6 +14,9 @@ #ifdef HAVE_SYS_TIME_H #include #endif +#ifdef HAVE_TIME_H +#include +#endif #ifdef HAVE_SYS_STAT_H #include #endif @@ -112,6 +115,30 @@ static int errorno = 0; * Internal timing routines to remove the necessity to have unix-specific * 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, endtime; @@ -152,6 +179,9 @@ static void endTimer(const char *format, ...) * This is obviously less accurate, but there's little we can do about * that. */ +#ifndef CLOCKS_PER_SEC +#define CLOCKS_PER_SEC 100 +#endif clock_t begin, endtime; static void startTimer(void) @@ -616,7 +646,7 @@ main(int argc, char **argv) done: xsltCleanupGlobals(); xmlCleanupParser(); -#ifdef WITH_MEM_DEBUG +#if 0 xmlMemoryDump(); #endif return(errorno);