[libxslt] Don't check for standard C89 headers
- From: Nick Wellnhofer <nwellnhof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxslt] Don't check for standard C89 headers
- Date: Thu, 31 Mar 2022 00:00:26 +0000 (UTC)
commit dd165086422ae8bea3cb90b621ba62d3b8feeac8
Author: Nick Wellnhofer <wellnhofer aevum de>
Date: Thu Mar 31 01:04:38 2022 +0200
Don't check for standard C89 headers
Also stop including non-standard headers.
CMakeLists.txt | 14 -------------
config.h.cmake.in | 45 ---------------------------------------
configure.ac | 6 ++----
libexslt/crypto.c | 3 ---
libexslt/date.c | 14 +------------
libexslt/math.c | 22 -------------------
libxslt/attributes.c | 19 -----------------
libxslt/extra.c | 2 --
libxslt/functions.c | 7 -------
libxslt/imports.c | 19 -----------------
libxslt/namespaces.c | 18 ----------------
libxslt/security.c | 16 --------------
libxslt/win32config.h | 7 -------
libxslt/xsltconfig.h.in | 1 -
libxslt/xsltutils.c | 7 +++----
libxslt/xsltutils.h | 3 ---
xsltproc/xsltproc.c | 56 ++++++-------------------------------------------
17 files changed, 12 insertions(+), 247 deletions(-)
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 10564f89..50e27bbf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -93,26 +93,19 @@ else()
set(CMAKE_REQUIRED_LIBRARIES m)
endif()
check_function_exists(clock_gettime HAVE_CLOCK_GETTIME)
- check_include_files(dlfcn.h HAVE_DLFCN_H)
check_function_exists(fabs HAVE_FABS)
- check_include_files(float.h HAVE_FLOAT_H)
check_function_exists(floor HAVE_FLOOR)
check_function_exists(fprintf HAVE_FPRINTF)
- check_include_files(fp_class.h HAVE_FP_CLASS_H)
check_function_exists(ftime HAVE_FTIME)
check_library_exists(gcrypt gcry_control "gcrypt.h" HAVE_GCRYPT)
check_function_exists(gettimeofday HAVE_GETTIMEOFDAY)
check_function_exists(gmtime HAVE_GMTIME)
check_function_exists(gmtime_r HAVE_GMTIME_R)
- check_include_files(ieeefp.h HAVE_IEEEFP_H)
check_include_files(inttypes.h HAVE_INTTYPES_H)
check_library_exists(pthread pthread_join "" HAVE_LIBPTHREAD)
check_include_files(locale.h HAVE_LOCALE_H)
check_function_exists(localtime HAVE_LOCALTIME)
check_function_exists(localtime_r HAVE_LOCALTIME_R)
- check_include_files(math.h HAVE_MATH_H)
- check_include_files(memory.h HAVE_MEMORY_H)
- check_include_files(nan.h HAVE_NAN_H)
check_function_exists(pow HAVE_POW)
check_function_exists(printf HAVE_PRINTF)
check_include_files(pthread.h HAVE_PTHREAD_H)
@@ -120,11 +113,6 @@ else()
check_function_exists(sprintf HAVE_SPRINTF)
check_function_exists(sscanf HAVE_SSCANF)
check_function_exists(stat HAVE_STAT)
- check_include_files(stdarg.h HAVE_STDARG_H)
- check_include_files(stdint.h HAVE_STDINT_H)
- check_include_files(stdlib.h HAVE_STDLIB_H)
- check_include_files(strings.h HAVE_STRINGS_H)
- check_include_files(string.h HAVE_STRING_H)
check_function_exists(strxfrm_l HAVE_STRXFRM_L)
check_include_files(sys/select.h HAVE_SYS_SELECT_H)
check_include_files(sys/stat.h HAVE_SYS_STAT_H)
@@ -132,7 +120,6 @@ else()
check_include_files(sys/time.h HAVE_SYS_TIME_H)
check_include_files(sys/types.h HAVE_SYS_TYPES_H)
check_function_exists(time HAVE_TIME)
- check_include_files(time.h HAVE_TIME_H)
check_include_files(unistd.h HAVE_UNISTD_H)
check_function_exists(vfprintf HAVE_VFPRINTF)
check_function_exists(vsnprintf HAVE_VSNPRINTF)
@@ -147,7 +134,6 @@ else()
set(PACKAGE_TARNAME "libxslt")
set(PACKAGE_URL "https://gitlab.gnome.org/GNOME/libxslt")
set(PACKAGE_VERSION ${LIBXSLT_DOTTED_VERSION})
- check_include_files("float.h;stdarg.h;stdlib.h;string.h" STDC_HEADERS)
set(_ALL_SOURCE ON)
set(_GNU_SOURCE ON)
set(_POSIX_PTHREAD_SEMANTICS ON)
diff --git a/config.h.cmake.in b/config.h.cmake.in
index 41607777..2a4de49e 100644
--- a/config.h.cmake.in
+++ b/config.h.cmake.in
@@ -4,27 +4,15 @@
/* Define to 1 if you have the `clock_gettime' function. */
#cmakedefine HAVE_CLOCK_GETTIME 1
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#cmakedefine HAVE_DLFCN_H 1
-
-/* Define to 1 if you have the <errno.h> header file. */
-#cmakedefine HAVE_ERRNO_H 1
-
/* Define if fabs is there */
#cmakedefine HAVE_FABS
-/* Define to 1 if you have the <float.h> header file. */
-#cmakedefine HAVE_FLOAT_H 1
-
/* Define if floor is there */
#cmakedefine HAVE_FLOOR
/* Define to 1 if you have the `fprintf' function. */
#cmakedefine HAVE_FPRINTF 1
-/* Define to 1 if you have the <fp_class.h> header file. */
-#cmakedefine HAVE_FP_CLASS_H 1
-
/* Define to 1 if you have the `ftime' function. */
#cmakedefine HAVE_FTIME 1
@@ -40,9 +28,6 @@
/* Define to 1 if you have the `gmtime_r' function. */
#cmakedefine HAVE_GMTIME_R 1
-/* Define to 1 if you have the <ieeefp.h> header file. */
-#cmakedefine HAVE_IEEEFP_H 1
-
/* Define to 1 if you have the <inttypes.h> header file. */
#cmakedefine HAVE_INTTYPES_H 1
@@ -58,15 +43,6 @@
/* Define to 1 if you have the `localtime_r' function. */
#cmakedefine HAVE_LOCALTIME_R 1
-/* Define to 1 if you have the <math.h> header file. */
-#cmakedefine HAVE_MATH_H 1
-
-/* Define to 1 if you have the <memory.h> header file. */
-#cmakedefine HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the <nan.h> header file. */
-#cmakedefine HAVE_NAN_H 1
-
/* Define if pow is there */
#cmakedefine HAVE_POW
@@ -88,21 +64,6 @@
/* Define to 1 if you have the `stat' function. */
#cmakedefine HAVE_STAT 1
-/* Define to 1 if you have the <stdarg.h> header file. */
-#cmakedefine HAVE_STDARG_H 1
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#cmakedefine HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#cmakedefine HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#cmakedefine HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#cmakedefine HAVE_STRING_H 1
-
/* Define to 1 if you have the `strxfrm_l' function. */
#cmakedefine HAVE_STRXFRM_L 1
@@ -124,9 +85,6 @@
/* Define to 1 if you have the `time' function. */
#cmakedefine HAVE_TIME 1
-/* Define to 1 if you have the <time.h> header file. */
-#cmakedefine HAVE_TIME_H 1
-
/* Define to 1 if you have the <unistd.h> header file. */
#cmakedefine HAVE_UNISTD_H 1
@@ -169,9 +127,6 @@
/* Define to the version of this package. */
#cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@"
-/* Define to 1 if you have the ANSI C header files. */
-#cmakedefine STDC_HEADERS 1
-
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
#cmakedefine _ALL_SOURCE 1
diff --git a/configure.ac b/configure.ac
index acb6177d..51b4da49 100644
--- a/configure.ac
+++ b/configure.ac
@@ -89,7 +89,7 @@ PKG_PROG_PKG_CONFIG
LT_INIT(win32-dll)
-AC_CHECK_HEADERS(sys/types.h sys/time.h stdlib.h unistd.h string.h)
+AC_CHECK_HEADERS(sys/types.h sys/time.h unistd.h)
dnl
dnl if the system support linker version scripts for symbol versioning
@@ -135,9 +135,7 @@ dnl
dnl Math detection
dnl
-AC_CHECK_HEADERS(ieeefp.h nan.h math.h fp_class.h float.h)
-AC_CHECK_HEADERS(sys/timeb.h time.h sys/stat.h sys/select.h stdarg.h)
-AC_CHECK_HEADERS(errno.h)
+AC_CHECK_HEADERS(sys/timeb.h sys/stat.h sys/select.h)
AC_CHECK_FUNCS(stat _stat)
AC_CHECK_FUNC(pow, , AC_CHECK_LIB(m, pow,
[M_LIBS="-lm"; AC_DEFINE([HAVE_POW],[], [Define if pow is there])]))
diff --git a/libexslt/crypto.c b/libexslt/crypto.c
index 1cd2b417..81f5b84e 100644
--- a/libexslt/crypto.c
+++ b/libexslt/crypto.c
@@ -315,9 +315,6 @@ exsltCryptoCryptoApiRc4Decrypt (xmlXPathParserContextPtr ctxt,
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h> /* needed by gcrypt.h 4 Jul 04 */
diff --git a/libexslt/date.c b/libexslt/date.c
index 8f34a75f..a16e26b8 100644
--- a/libexslt/date.c
+++ b/libexslt/date.c
@@ -40,13 +40,8 @@
#include <string.h>
#include <limits.h>
-
-#ifdef HAVE_ERRNO_H
#include <errno.h>
-#endif
-#ifdef HAVE_MATH_H
#include <math.h>
-#endif
/* needed to get localtime_r on Solaris */
#ifdef __sun
@@ -55,9 +50,7 @@
#endif
#endif
-#ifdef HAVE_TIME_H
#include <time.h>
-#endif
/*
* types of date and/or time (from schema datatypes)
@@ -107,8 +100,7 @@ struct _exsltDateDurVal {
* *
****************************************************************/
-#if defined(HAVE_TIME_H) \
- && (defined(HAVE_LOCALTIME) || defined(HAVE_LOCALTIME_R)) \
+#if (defined(HAVE_LOCALTIME) || defined(HAVE_LOCALTIME_R)) \
&& (defined(HAVE_GMTIME) || defined(HAVE_GMTIME_R)) \
&& defined(HAVE_TIME)
#define WITH_TIME
@@ -745,16 +737,13 @@ exsltDateCurrent (void)
time_t secs;
int local_s, gm_s;
exsltDateValPtr ret;
-#ifdef HAVE_ERRNO_H
char *source_date_epoch;
-#endif /* HAVE_ERRNO_H */
int override = 0;
ret = exsltDateCreateDate(XS_DATETIME);
if (ret == NULL)
return NULL;
-#ifdef HAVE_ERRNO_H
/*
* Allow the date and time to be set externally by an exported
* environment variable to enable reproducible builds.
@@ -776,7 +765,6 @@ exsltDateCurrent (void)
#endif
}
}
-#endif /* HAVE_ERRNO_H */
if (override == 0) {
/* get current time */
diff --git a/libexslt/math.c b/libexslt/math.c
index b70f2eb5..17138b20 100644
--- a/libexslt/math.c
+++ b/libexslt/math.c
@@ -9,13 +9,8 @@
#include <libxslt/xsltInternals.h>
#include <libxslt/extensions.h>
-#ifdef HAVE_MATH_H
#include <math.h>
-#endif
-
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
#include "exslt.h"
@@ -453,8 +448,6 @@ exsltMathConstantFunction (xmlXPathParserContextPtr ctxt, int nargs) {
xmlXPathReturnNumber(ctxt, ret);
}
-#if defined(HAVE_STDLIB_H) && defined(RAND_MAX)
-
/**
* exsltMathRandom:
*
@@ -494,10 +487,6 @@ exsltMathRandomFunction (xmlXPathParserContextPtr ctxt, int nargs) {
xmlXPathReturnNumber(ctxt, ret);
}
-#endif /* defined(HAVE_STDLIB_H) && defined(RAND_MAX) */
-
-#if HAVE_MATH_H
-
/**
* exsltMathAbs:
* @num: a double
@@ -1029,8 +1018,6 @@ exsltMathExpFunction (xmlXPathParserContextPtr ctxt, int nargs) {
xmlXPathReturnNumber(ctxt, ret);
}
-#endif /* HAVE_MATH_H */
-
/**
* exsltMathRegister:
*
@@ -1051,16 +1038,12 @@ exsltMathRegister (void) {
xsltRegisterExtModuleFunction ((const xmlChar *) "lowest",
EXSLT_MATH_NAMESPACE,
exsltMathLowestFunction);
- /* register other math functions */
xsltRegisterExtModuleFunction ((const xmlChar *) "constant",
EXSLT_MATH_NAMESPACE,
exsltMathConstantFunction);
-#ifdef HAVE_STDLIB_H
xsltRegisterExtModuleFunction ((const xmlChar *) "random",
EXSLT_MATH_NAMESPACE,
exsltMathRandomFunction);
-#endif
-#if HAVE_MATH_H
xsltRegisterExtModuleFunction ((const xmlChar *) "abs",
EXSLT_MATH_NAMESPACE,
exsltMathAbsFunction);
@@ -1097,7 +1080,6 @@ exsltMathRegister (void) {
xsltRegisterExtModuleFunction ((const xmlChar *) "exp",
EXSLT_MATH_NAMESPACE,
exsltMathExpFunction);
-#endif
}
/**
@@ -1129,13 +1111,10 @@ exsltMathXpathCtxtRegister (xmlXPathContextPtr ctxt, const xmlChar *prefix)
(const xmlChar *) "lowest",
(const xmlChar *) EXSLT_MATH_NAMESPACE,
exsltMathLowestFunction)
-#ifdef HAVE_STDLIB_H
&& !xmlXPathRegisterFuncNS(ctxt,
(const xmlChar *) "random",
(const xmlChar *) EXSLT_MATH_NAMESPACE,
exsltMathRandomFunction)
-#endif
-#if HAVE_MATH_H
&& !xmlXPathRegisterFuncNS(ctxt,
(const xmlChar *) "abs",
(const xmlChar *) EXSLT_MATH_NAMESPACE,
@@ -1184,7 +1163,6 @@ exsltMathXpathCtxtRegister (xmlXPathContextPtr ctxt, const xmlChar *prefix)
(const xmlChar *) "exp",
(const xmlChar *) EXSLT_MATH_NAMESPACE,
exsltMathExpFunction)
-#endif
&& !xmlXPathRegisterFuncNS(ctxt,
(const xmlChar *) "constant",
(const xmlChar *) EXSLT_MATH_NAMESPACE,
diff --git a/libxslt/attributes.c b/libxslt/attributes.c
index 72c619ae..8a64f3e7 100644
--- a/libxslt/attributes.c
+++ b/libxslt/attributes.c
@@ -14,25 +14,6 @@
#include <string.h>
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-#ifdef HAVE_FLOAT_H
-#include <float.h>
-#endif
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>
-#endif
-#ifdef HAVE_NAN_H
-#include <nan.h>
-#endif
-#ifdef HAVE_CTYPE_H
-#include <ctype.h>
-#endif
-
#include <libxml/xmlmemory.h>
#include <libxml/tree.h>
#include <libxml/hash.h>
diff --git a/libxslt/extra.c b/libxslt/extra.c
index 461237e7..69f835d9 100644
--- a/libxslt/extra.c
+++ b/libxslt/extra.c
@@ -14,9 +14,7 @@
#include "libxslt.h"
#include <string.h>
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
#include <libxml/xmlmemory.h>
#include <libxml/tree.h>
diff --git a/libxslt/functions.c b/libxslt/functions.c
index 7887dda7..fa20f317 100644
--- a/libxslt/functions.c
+++ b/libxslt/functions.c
@@ -15,13 +15,6 @@
#include <string.h>
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_CTYPE_H
-#include <ctype.h>
-#endif
-
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
diff --git a/libxslt/imports.c b/libxslt/imports.c
index 3783b247..4f5de03f 100644
--- a/libxslt/imports.c
+++ b/libxslt/imports.c
@@ -14,25 +14,6 @@
#include <string.h>
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-#ifdef HAVE_FLOAT_H
-#include <float.h>
-#endif
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>
-#endif
-#ifdef HAVE_NAN_H
-#include <nan.h>
-#endif
-#ifdef HAVE_CTYPE_H
-#include <ctype.h>
-#endif
-
#include <libxml/xmlmemory.h>
#include <libxml/tree.h>
#include <libxml/hash.h>
diff --git a/libxslt/namespaces.c b/libxslt/namespaces.c
index 07a7705b..651c422a 100644
--- a/libxslt/namespaces.c
+++ b/libxslt/namespaces.c
@@ -14,24 +14,6 @@
#include <string.h>
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-#ifdef HAVE_FLOAT_H
-#include <float.h>
-#endif
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>
-#endif
-#ifdef HAVE_NAN_H
-#include <nan.h>
-#endif
-#ifdef HAVE_CTYPE_H
-#include <ctype.h>
-#endif
#ifndef XSLT_NEED_TRIO
#include <stdio.h>
#else
diff --git a/libxslt/security.c b/libxslt/security.c
index 8e47d4b9..5cae4da4 100644
--- a/libxslt/security.c
+++ b/libxslt/security.c
@@ -18,22 +18,6 @@
#include <sys/stat.h>
#endif
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-#ifdef HAVE_FLOAT_H
-#include <float.h>
-#endif
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>
-#endif
-#ifdef HAVE_NAN_H
-#include <nan.h>
-#endif
-#ifdef HAVE_CTYPE_H
-#include <ctype.h>
-#endif
-
#if defined(_WIN32) && !defined(__CYGWIN__)
#include <windows.h>
#ifndef INVALID_FILE_ATTRIBUTES
diff --git a/libxslt/win32config.h b/libxslt/win32config.h
index 8fe70427..688983c3 100644
--- a/libxslt/win32config.h
+++ b/libxslt/win32config.h
@@ -9,15 +9,9 @@
#ifndef __LIBXSLT_WIN32_CONFIG__
#define __LIBXSLT_WIN32_CONFIG__
-#define HAVE_CTYPE_H 1
-#define HAVE_STDLIB_H 1
-#define HAVE_STDARG_H 1
-#define HAVE_MALLOC_H 1
-#define HAVE_TIME_H 1
#define HAVE_LOCALTIME 1
#define HAVE_GMTIME 1
#define HAVE_TIME 1
-#define HAVE_MATH_H 1
#define HAVE_FCNTL_H 1
#include <io.h>
@@ -115,7 +109,6 @@ __inline int c99_snprintf(char *outBuf, size_t size, const char *format, ...)
#define HAVE_SYS_STAT_H
#define HAVE__STAT
-#define HAVE_STRING_H
#include <libxml/xmlversion.h>
diff --git a/libxslt/xsltconfig.h.in b/libxslt/xsltconfig.h.in
index a5d293aa..e115e496 100644
--- a/libxslt/xsltconfig.h.in
+++ b/libxslt/xsltconfig.h.in
@@ -86,7 +86,6 @@ extern "C" {
#define XSLT_NEED_TRIO
#endif
#ifdef __VMS
-#define HAVE_MATH_H 1
#define HAVE_SYS_STAT_H 1
#ifndef XSLT_NEED_TRIO
#define XSLT_NEED_TRIO
diff --git a/libxslt/xsltutils.c b/libxslt/xsltutils.c
index fdf7dec2..28a7f2d7 100644
--- a/libxslt/xsltutils.c
+++ b/libxslt/xsltutils.c
@@ -19,17 +19,16 @@
#endif
#include <string.h>
+#include <stdlib.h>
+#include <stdarg.h>
#include <time.h>
+
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#include <stdarg.h>
#include <libxml/xmlmemory.h>
#include <libxml/tree.h>
diff --git a/libxslt/xsltutils.h b/libxslt/xsltutils.h
index ea6c3740..12e4c75f 100644
--- a/libxslt/xsltutils.h
+++ b/libxslt/xsltutils.h
@@ -13,9 +13,6 @@
#define __XML_XSLTUTILS_H__
#include <libxslt/xsltconfig.h>
-#ifdef HAVE_STDARG_H
-#include <stdarg.h>
-#endif
#include <libxml/xpath.h>
#include <libxml/dict.h>
#include <libxml/xmlerror.h>
diff --git a/xsltproc/xsltproc.c b/xsltproc/xsltproc.c
index 5fd3a290..90bb9fd3 100644
--- a/xsltproc/xsltproc.c
+++ b/xsltproc/xsltproc.c
@@ -9,28 +9,22 @@
#include "libxslt/libxslt.h"
#include "libxslt/xsltconfig.h"
#include "libexslt/exslt.h"
+
#include <stdio.h>
-#ifdef HAVE_STRING_H
#include <string.h>
-#endif
+#include <stdlib.h>
+#include <stdarg.h>
+#include <time.h>
+
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
-#ifdef HAVE_TIME_H
-#include <time.h>
-#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_STDARG_H
-#include <stdarg.h>
-#endif
#if defined(_WIN32) && !defined(__CYGWIN__)
#include <fcntl.h>
#endif
@@ -57,12 +51,6 @@
#include <libexslt/exsltconfig.h>
-#if defined(HAVE_SYS_TIME_H)
-#include <sys/time.h>
-#elif defined(HAVE_TIME_H)
-#include <time.h>
-#endif
-
#ifdef HAVE_SYS_TIMEB_H
#include <sys/timeb.h>
#endif
@@ -265,16 +253,13 @@ static void endTimer(const char *format, ...)
msec *= 1000;
msec += (endtime.tv_usec - begin.tv_usec) / 1000;
-#ifndef HAVE_STDARG_H
-#error "endTimer required stdarg functions"
-#endif
va_start(ap, format);
vfprintf(stderr,format,ap);
va_end(ap);
fprintf(stderr, " took %ld ms\n", msec);
}
-#elif defined(HAVE_TIME_H)
+#else
/*
* No gettimeofday function, so we have to make do with calling clock.
* This is obviously less accurate, but there's little we can do about
@@ -297,40 +282,11 @@ static void endTimer(const char *format, ...)
endtime=clock();
msec = ((endtime-begin) * 1000) / CLOCKS_PER_SEC;
-#ifndef HAVE_STDARG_H
-#error "endTimer required stdarg functions"
-#endif
va_start(ap, format);
vfprintf(stderr,format,ap);
va_end(ap);
fprintf(stderr, " took %ld ms\n", msec);
}
-#else
-/*
- * We don't have a gettimeofday or time.h, so we just don't do timing
- */
-static void startTimer(void)
-{
- /*
- * Do nothing
- */
-}
-static void endTimer(const char *format, ...)
-{
- /*
- * We cannot do anything because we don't have a timing function
- */
-#ifdef HAVE_STDARG_H
- va_start(ap, format);
- vfprintf(stderr,format,ap);
- va_end(ap);
- fprintf(stderr, " was not timed\n");
-#else
- /* We don't have gettimeofday, time or stdarg.h, what crazy world is
- * this ?!
- */
-#endif
-}
#endif
/*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]