summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2022-03-02 00:29:17 +0100
committerNick Wellnhofer <wellnhofer@aevum.de>2022-03-02 00:43:54 +0100
commit776d15d38359255434f5d55722430dfcb7b3eba5 (patch)
tree2c205ab402f337d78864fc601e3c9e1c777898c6
parent8f3bd262413fbac0c2314249ea3836667fce4538 (diff)
downloadlibxml2-776d15d38359255434f5d55722430dfcb7b3eba5.tar.gz
Don't check for standard C89 headers
Don't check for - ctype.h - errno.h - float.h - limits.h - math.h - signal.h - stdarg.h - stdlib.h - string.h - time.h Stop including non-standard headers - malloc.h - strings.h
-rw-r--r--CMakeLists.txt12
-rw-r--r--HTMLparser.c5
-rw-r--r--HTMLtree.c5
-rw-r--r--buf.c4
-rw-r--r--c14n.c2
-rw-r--r--catalog.c6
-rw-r--r--config.h.cmake.in36
-rw-r--r--configure.ac10
-rw-r--r--debugXML.c6
-rw-r--r--dict.c4
-rw-r--r--encoding.c9
-rw-r--r--entities.c3
-rw-r--r--globals.c2
-rw-r--r--hash.c4
-rw-r--r--include/win32config.h11
-rw-r--r--nanoftp.c12
-rw-r--r--nanohttp.c11
-rw-r--r--os400/os400config.h.in36
-rw-r--r--parser.c8
-rw-r--r--parserInternals.c5
-rw-r--r--testC14N.c5
-rw-r--r--testHTML.c5
-rw-r--r--testOOM.c7
-rw-r--r--testOOMlib.c3
-rw-r--r--testReader.c8
-rw-r--r--testRelax.c5
-rw-r--r--testSAX.c60
-rw-r--r--testSchemas.c5
-rw-r--r--testXPath.c5
-rw-r--r--threads.c4
-rw-r--r--tree.c5
-rw-r--r--trio.c3
-rw-r--r--valid.c3
-rwxr-xr-xvms/config.vms30
-rw-r--r--xlink.c5
-rw-r--r--xmlIO.c10
-rw-r--r--xmlcatalog.c3
-rw-r--r--xmllint.c48
-rw-r--r--xmlmemory.c25
-rw-r--r--xmlreader.c5
-rw-r--r--xmlregexp.c3
-rw-r--r--xmlschemastypes.c10
-rw-r--r--xpath.c15
-rw-r--r--xzlib.c7
44 files changed, 49 insertions, 421 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f922d5ab..7987ecbb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -160,13 +160,10 @@ else()
set(ss_family __ss_family)
endif()
check_function_exists(class HAVE_CLASS)
- check_include_files(ctype.h HAVE_CTYPE_H)
check_include_files(dlfcn.h HAVE_DLFCN_H)
check_library_exists(dl dlopen "" HAVE_DLOPEN)
check_include_files(dl.h HAVE_DL_H)
- check_include_files(errno.h HAVE_ERRNO_H)
check_include_files(fcntl.h HAVE_FCNTL_H)
- check_include_files(float.h HAVE_FLOAT_H)
check_function_exists(fpclass HAVE_FPCLASS)
check_function_exists(fprintf HAVE_FPRINTF)
check_function_exists(ftime HAVE_FTIME)
@@ -176,10 +173,7 @@ else()
check_function_exists(isascii HAVE_ISASCII)
check_library_exists(history append_history "" HAVE_LIBHISTORY)
check_library_exists(readline readline "" HAVE_LIBREADLINE)
- check_include_files(limits.h HAVE_LIMITS_H)
check_function_exists(localtime HAVE_LOCALTIME)
- check_include_files(malloc.h HAVE_MALLOC_H)
- check_include_files(math.h HAVE_MATH_H)
check_function_exists(mmap HAVE_MMAP)
check_function_exists(munmap HAVE_MUNMAP)
check_include_files(netdb.h HAVE_NETDB_H)
@@ -192,18 +186,13 @@ else()
check_function_exists(rand_r HAVE_RAND_R)
check_include_files(resolv.h HAVE_RESOLV_H)
check_library_exists(dld shl_load "" HAVE_SHLLOAD)
- check_include_files(signal.h HAVE_SIGNAL_H)
check_function_exists(snprintf HAVE_SNPRINTF)
check_function_exists(sprintf HAVE_SPRINTF)
check_function_exists(srand HAVE_SRAND)
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_function_exists(strftime HAVE_STRFTIME)
- check_include_files(strings.h HAVE_STRINGS_H)
- check_include_files(string.h HAVE_STRING_H)
check_include_files(sys/mman.h HAVE_SYS_MMAN_H)
check_include_files(sys/select.h HAVE_SYS_SELECT_H)
check_include_files(sys/socket.h HAVE_SYS_SOCKET_H)
@@ -212,7 +201,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(va_copy HAVE_VA_COPY)
check_function_exists(vfprintf HAVE_VFPRINTF)
diff --git a/HTMLparser.c b/HTMLparser.c
index e72f4185..e4481281 100644
--- a/HTMLparser.c
+++ b/HTMLparser.c
@@ -11,12 +11,9 @@
#ifdef LIBXML_HTML_ENABLED
#include <string.h>
-#ifdef HAVE_CTYPE_H
#include <ctype.h>
-#endif
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
+
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
diff --git a/HTMLtree.c b/HTMLtree.c
index b098de74..c6ca8358 100644
--- a/HTMLtree.c
+++ b/HTMLtree.c
@@ -12,13 +12,8 @@
#ifdef LIBXML_HTML_ENABLED
#include <string.h> /* for memset() only ! */
-
-#ifdef HAVE_CTYPE_H
#include <ctype.h>
-#endif
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
#include <libxml/xmlmemory.h>
#include <libxml/HTMLparser.h>
diff --git a/buf.c b/buf.c
index 11be3c64..f4356540 100644
--- a/buf.c
+++ b/buf.c
@@ -17,12 +17,8 @@
#include <string.h> /* for memset() only ! */
#include <limits.h>
-#ifdef HAVE_CTYPE_H
#include <ctype.h>
-#endif
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
#include <libxml/tree.h>
#include <libxml/globals.h>
diff --git a/c14n.c b/c14n.c
index 82f2751f..7a3960c3 100644
--- a/c14n.c
+++ b/c14n.c
@@ -14,9 +14,7 @@
#ifdef LIBXML_C14N_ENABLED
#ifdef LIBXML_OUTPUT_ENABLED
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
#include <string.h>
#include <libxml/tree.h>
diff --git a/catalog.c b/catalog.c
index 50e03533..729fa55e 100644
--- a/catalog.c
+++ b/catalog.c
@@ -16,6 +16,8 @@
#include "libxml.h"
#ifdef LIBXML_CATALOG_ENABLED
+#include <stdlib.h>
+#include <string.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
@@ -28,10 +30,6 @@
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#include <string.h>
#include <libxml/xmlmemory.h>
#include <libxml/hash.h>
#include <libxml/uri.h>
diff --git a/config.h.cmake.in b/config.h.cmake.in
index e0935634..bdbc50be 100644
--- a/config.h.cmake.in
+++ b/config.h.cmake.in
@@ -16,9 +16,6 @@
/* Whether struct sockaddr::__ss_family exists */
#cmakedefine HAVE_BROKEN_SS_FAMILY 1
-/* Define to 1 if you have the <ctype.h> header file. */
-#cmakedefine HAVE_CTYPE_H 1
-
/* Define to 1 if you have the <dlfcn.h> header file. */
#cmakedefine HAVE_DLFCN_H 1
@@ -28,15 +25,9 @@
/* Define to 1 if you have the <dl.h> header file. */
#cmakedefine HAVE_DL_H 1
-/* Define to 1 if you have the <errno.h> header file. */
-#cmakedefine HAVE_ERRNO_H 1
-
/* Define to 1 if you have the <fcntl.h> header file. */
#cmakedefine HAVE_FCNTL_H 1
-/* Define to 1 if you have the <float.h> header file. */
-#cmakedefine HAVE_FLOAT_H 1
-
/* Define to 1 if you have the `fprintf' function. */
#cmakedefine HAVE_FPRINTF 1
@@ -61,18 +52,9 @@
/* Define if readline library is there (-lreadline) */
#cmakedefine HAVE_LIBREADLINE 1
-/* Define to 1 if you have the <limits.h> header file. */
-#cmakedefine HAVE_LIMITS_H 1
-
/* Define to 1 if you have the `localtime' function. */
#cmakedefine HAVE_LOCALTIME 1
-/* Define to 1 if you have the <malloc.h> header file. */
-#cmakedefine HAVE_MALLOC_H 1
-
-/* Define to 1 if you have the <math.h> header file. */
-#cmakedefine HAVE_MATH_H 1
-
/* Define to 1 if you have the `mmap' function. */
#cmakedefine HAVE_MMAP 1
@@ -114,9 +96,6 @@
/* Have shl_load based dso */
#cmakedefine HAVE_SHLLOAD 1
-/* Define to 1 if you have the <signal.h> header file. */
-#cmakedefine HAVE_SIGNAL_H 1
-
/* Define to 1 if you have the `snprintf' function. */
#cmakedefine HAVE_SNPRINTF 1
@@ -132,24 +111,12 @@
/* 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 `strftime' function. */
#cmakedefine HAVE_STRFTIME 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 <sys/mman.h> header file. */
#cmakedefine HAVE_SYS_MMAN_H 1
@@ -174,9 +141,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
diff --git a/configure.ac b/configure.ac
index 6d7018eb..68d21433 100644
--- a/configure.ac
+++ b/configure.ac
@@ -446,19 +446,10 @@ AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h])
AC_CHECK_HEADERS([unistd.h])
-AC_CHECK_HEADERS([ctype.h])
-AC_CHECK_HEADERS([errno.h])
-AC_CHECK_HEADERS([malloc.h])
-AC_CHECK_HEADERS([stdarg.h])
AC_CHECK_HEADERS([sys/stat.h])
AC_CHECK_HEADERS([sys/types.h])
AC_CHECK_HEADERS([stdint.h])
AC_CHECK_HEADERS([inttypes.h])
-AC_CHECK_HEADERS([time.h])
-AC_CHECK_HEADERS([math.h])
-AC_CHECK_HEADERS([limits.h])
-AC_CHECK_HEADERS([float.h])
-AC_CHECK_HEADERS([stdlib.h])
AC_CHECK_HEADERS([sys/socket.h], [], [],
[#if HAVE_SYS_TYPES_H
# include <sys/types.h>
@@ -483,7 +474,6 @@ AC_CHECK_HEADERS([sys/select.h])
AC_CHECK_HEADERS([poll.h])
AC_CHECK_HEADERS([sys/mman.h])
AC_CHECK_HEADERS([sys/timeb.h])
-AC_CHECK_HEADERS([signal.h])
AC_CHECK_HEADERS([arpa/nameser.h], [], [],
[#if HAVE_SYS_TYPES_H
# include <sys/types.h>
diff --git a/debugXML.c b/debugXML.c
index 3f28c67d..5f73fce7 100644
--- a/debugXML.c
+++ b/debugXML.c
@@ -12,12 +12,8 @@
#ifdef LIBXML_DEBUG_ENABLED
#include <string.h>
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
+
#include <libxml/xmlmemory.h>
#include <libxml/tree.h>
#include <libxml/parser.h>
diff --git a/dict.c b/dict.c
index 5e395110..60b69a4e 100644
--- a/dict.c
+++ b/dict.c
@@ -20,12 +20,8 @@
#include "libxml.h"
#include <limits.h>
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
-#ifdef HAVE_TIME_H
#include <time.h>
-#endif
/*
* Following http://www.ocert.org/advisories/ocert-2011-003.html
diff --git a/encoding.c b/encoding.c
index bfa5a304..8b01b96c 100644
--- a/encoding.c
+++ b/encoding.c
@@ -25,18 +25,13 @@
#include <string.h>
#include <limits.h>
-
-#ifdef HAVE_CTYPE_H
#include <ctype.h>
-#endif
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
+
#ifdef LIBXML_ICONV_ENABLED
-#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
-#endif
+
#include <libxml/encoding.h>
#include <libxml/xmlmemory.h>
#ifdef LIBXML_HTML_ENABLED
diff --git a/entities.c b/entities.c
index 37163c19..84435515 100644
--- a/entities.c
+++ b/entities.c
@@ -15,9 +15,8 @@
#include "libxml.h"
#include <string.h>
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
+
#include <libxml/xmlmemory.h>
#include <libxml/hash.h>
#include <libxml/entities.h>
diff --git a/globals.c b/globals.c
index 2bc3db27..4aec8123 100644
--- a/globals.c
+++ b/globals.c
@@ -14,9 +14,7 @@
#define IN_LIBXML
#include "libxml.h"
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
#include <string.h>
#include <libxml/globals.h>
diff --git a/hash.c b/hash.c
index 005401b7..6562d308 100644
--- a/hash.c
+++ b/hash.c
@@ -21,12 +21,8 @@
#include "libxml.h"
#include <string.h>
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
-#ifdef HAVE_TIME_H
#include <time.h>
-#endif
/*
* Following http://www.ocert.org/advisories/ocert-2011-003.html
diff --git a/include/win32config.h b/include/win32config.h
index 54392f49..d804404a 100644
--- a/include/win32config.h
+++ b/include/win32config.h
@@ -1,25 +1,14 @@
#ifndef __LIBXML_WIN32_CONFIG__
#define __LIBXML_WIN32_CONFIG__
-#define HAVE_CTYPE_H
-#define HAVE_STDARG_H
-#define HAVE_MALLOC_H
-#define HAVE_ERRNO_H
#define SEND_ARG2_CAST
#define GETHOSTBYNAME_ARG_CAST
-#if defined(_WIN32_WCE)
-#undef HAVE_ERRNO_H
-#include "wincecompat.h"
-#else
#define HAVE_SYS_STAT_H
#define HAVE_STAT
-#define HAVE_STDLIB_H
-#define HAVE_TIME_H
#define HAVE_FCNTL_H
#include <io.h>
#include <direct.h>
-#endif
#include <libxml/xmlversion.h>
diff --git a/nanoftp.c b/nanoftp.c
index bfc77b60..6de7d300 100644
--- a/nanoftp.c
+++ b/nanoftp.c
@@ -6,7 +6,6 @@
#ifdef TESTING
#define STANDALONE
-#define HAVE_STDLIB_H
#define HAVE_UNISTD_H
#define HAVE_SYS_SOCKET_H
#define HAVE_NETINET_IN_H
@@ -19,10 +18,9 @@
#ifdef LIBXML_FTP_ENABLED
#include <string.h>
-
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
+#include <errno.h>
+
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -41,9 +39,6 @@
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
@@ -56,9 +51,6 @@
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
diff --git a/nanohttp.c b/nanohttp.c
index 0d0e74f8..2eafd3f4 100644
--- a/nanohttp.c
+++ b/nanohttp.c
@@ -16,10 +16,9 @@
#ifdef LIBXML_HTTP_ENABLED
#include <string.h>
-
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
+#include <errno.h>
+
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -47,9 +46,6 @@
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
@@ -60,9 +56,6 @@
#else
#include <poll.h>
#endif
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
#ifdef LIBXML_ZLIB_ENABLED
#include <zlib.h>
#endif
diff --git a/os400/os400config.h.in b/os400/os400config.h.in
index 1588cfad..1f79cb7f 100644
--- a/os400/os400config.h.in
+++ b/os400/os400config.h.in
@@ -15,9 +15,6 @@
/* Whether struct sockaddr::__ss_family exists */
#undef HAVE_BROKEN_SS_FAMILY
-/* Define to 1 if you have the <ctype.h> header file. */
-#define HAVE_CTYPE_H 1
-
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1 /* Locally emulated. */
@@ -27,15 +24,9 @@
/* Define to 1 if you have the <dl.h> header file. */
#undef HAVE_DL_H
-/* Define to 1 if you have the <errno.h> header file. */
-#define HAVE_ERRNO_H 1
-
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
-/* Define to 1 if you have the <float.h> header file. */
-#define HAVE_FLOAT_H 1
-
/* Define to 1 if you have the `fprintf' function. */
#undef HAVE_FPRINTF /* Use trio. */
@@ -60,18 +51,9 @@
/* Define if readline library is there (-lreadline) */
#undef HAVE_LIBREADLINE
-/* Define to 1 if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
/* Define to 1 if you have the `localtime' function. */
#define HAVE_LOCALTIME 1
-/* Define to 1 if you have the <malloc.h> header file. */
-#undef HAVE_MALLOC_H
-
-/* Define to 1 if you have the <math.h> header file. */
-#define HAVE_MATH_H 1
-
/* Define to 1 if you have the `mmap' function. */
#undef HAVE_MMAP
@@ -116,9 +98,6 @@
/* Have shl_load based dso */
#undef HAVE_SHLLOAD
-/* Define to 1 if you have the <signal.h> header file. */
-#define HAVE_SIGNAL_H 1
-
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF /* Use trio. */
@@ -140,24 +119,12 @@
/* Define to 1 if you have the `stat' function. */
#define HAVE_STAT 1
-/* Define to 1 if you have the <stdarg.h> header file. */
-#define HAVE_STDARG_H 1 /* Overloaded */
-
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
/* Define to 1 if you have the `strftime' function. */
#define HAVE_STRFTIME 1
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
/* Define to 1 if you have the <sys/mman.h> header file. */
#define HAVE_SYS_MMAN_H 1
@@ -182,9 +149,6 @@
/* Define to 1 if you have the `time' function. */
#define HAVE_TIME 1
-/* Define to 1 if you have the <time.h> header file. */
-#define HAVE_TIME_H 1
-
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
diff --git a/parser.c b/parser.c
index 3aecf3e9..97747a7a 100644
--- a/parser.c
+++ b/parser.c
@@ -49,6 +49,8 @@
#include <string.h>
#include <stdarg.h>
#include <stddef.h>
+#include <ctype.h>
+#include <stdlib.h>
#include <libxml/xmlmemory.h>
#include <libxml/threads.h>
#include <libxml/globals.h>
@@ -68,12 +70,6 @@
#include <libxml/xmlschemastypes.h>
#include <libxml/relaxng.h>
#endif
-#ifdef HAVE_CTYPE_H
-#include <ctype.h>
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
diff --git a/parserInternals.c b/parserInternals.c
index 1421681c..d7b19b64 100644
--- a/parserInternals.c
+++ b/parserInternals.c
@@ -17,12 +17,9 @@
#endif
#include <string.h>
-#ifdef HAVE_CTYPE_H
#include <ctype.h>
-#endif
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
+
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
diff --git a/testC14N.c b/testC14N.c
index addc800e..ebd9fe01 100644
--- a/testC14N.c
+++ b/testC14N.c
@@ -11,6 +11,8 @@
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
+
#ifndef STDOUT_FILENO
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@@ -21,9 +23,6 @@
#ifdef _WIN32
#include <io.h>
#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
diff --git a/testHTML.c b/testHTML.c
index ee4d3e45..5d175904 100644
--- a/testHTML.c
+++ b/testHTML.c
@@ -12,7 +12,7 @@
#include <string.h>
#include <stdarg.h>
-
+#include <stdlib.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -26,9 +26,6 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
#include <libxml/xmlmemory.h>
#include <libxml/HTMLparser.h>
diff --git a/testOOM.c b/testOOM.c
index 9ff13f2f..dd13031b 100644
--- a/testOOM.c
+++ b/testOOM.c
@@ -10,6 +10,7 @@
#include <string.h>
#include <stdarg.h>
+#include <stdlib.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -17,12 +18,6 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
#include <libxml/xmlreader.h>
diff --git a/testOOMlib.c b/testOOMlib.c
index 34c4aa0a..310714fa 100644
--- a/testOOMlib.c
+++ b/testOOMlib.c
@@ -9,10 +9,7 @@
#include "testOOMlib.h"
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
-
#include <string.h>
#define _TEST_INT_MAX 2147483647
diff --git a/testReader.c b/testReader.c
index da2f1b02..70d5ee7e 100644
--- a/testReader.c
+++ b/testReader.c
@@ -11,6 +11,7 @@
#ifdef LIBXML_READER_ENABLED
#include <string.h>
#include <stdarg.h>
+#include <stdlib.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -24,13 +25,6 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
#include <libxml/xmlreader.h>
diff --git a/testRelax.c b/testRelax.c
index 3549f938..ad801b12 100644
--- a/testRelax.c
+++ b/testRelax.c
@@ -15,7 +15,7 @@
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
-
+#include <stdlib.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -29,9 +29,6 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
/* seems needed for Solaris */
diff --git a/testSAX.c b/testSAX.c
index b2d1363a..9cc72f21 100644
--- a/testSAX.c
+++ b/testSAX.c
@@ -8,20 +8,20 @@
#include "libxml.h"
+#ifdef LIBXML_SAX1_ENABLED
+
+#include <string.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_SYS_TIMEB_H
#include <sys/timeb.h>
#endif
-#ifdef HAVE_TIME_H
-#include <time.h>
-#endif
-
-#ifdef LIBXML_SAX1_ENABLED
-#include <string.h>
-#include <stdarg.h>
-
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
@@ -34,13 +34,6 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
#include <libxml/globals.h>
#include <libxml/xmlerror.h>
@@ -124,16 +117,13 @@ endTimer(const char *fmt, ...)
msec *= 1000;
msec += (end.tv_usec - begin.tv_usec) / 1000;
-#ifndef HAVE_STDARG_H
-#error "endTimer required stdarg functions"
-#endif
va_start(ap, fmt);
vfprintf(stderr, fmt, 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
@@ -158,43 +148,11 @@ endTimer(const char *fmt, ...)
end = clock();
msec = ((end - begin) * 1000) / CLOCKS_PER_SEC;
-#ifndef HAVE_STDARG_H
-#error "endTimer required stdarg functions"
-#endif
va_start(ap, fmt);
vfprintf(stderr, fmt, 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 XMLCDECL
-endTimer(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", msec);
-#else
- /* We don't have gettimeofday, time or stdarg.h, what crazy world is
- * this ?!
- */
-#endif
-}
#endif
/*
diff --git a/testSchemas.c b/testSchemas.c
index fc39862c..f79adf04 100644
--- a/testSchemas.c
+++ b/testSchemas.c
@@ -15,7 +15,7 @@
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
-
+#include <stdlib.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -29,9 +29,6 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
/* seems needed for Solaris */
diff --git a/testXPath.c b/testXPath.c
index d120f4e5..0e377237 100644
--- a/testXPath.c
+++ b/testXPath.c
@@ -10,6 +10,7 @@
#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
#include <string.h>
+#include <stdlib.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -23,10 +24,6 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
#include <libxml/xpath.h>
#include <libxml/tree.h>
diff --git a/threads.c b/threads.c
index 42ab82f4..5e4db16c 100644
--- a/threads.c
+++ b/threads.c
@@ -11,6 +11,7 @@
#include "libxml.h"
#include <string.h>
+#include <stdlib.h>
#include <libxml/threads.h>
#include <libxml/globals.h>
@@ -21,9 +22,6 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
#ifdef HAVE_PTHREAD_H
#include <pthread.h>
#elif defined HAVE_WIN32_THREADS
diff --git a/tree.c b/tree.c
index cbaec5b0..1253274f 100644
--- a/tree.c
+++ b/tree.c
@@ -21,12 +21,9 @@
#include <string.h> /* for memset() only ! */
#include <stddef.h>
#include <limits.h>
-#ifdef HAVE_CTYPE_H
#include <ctype.h>
-#endif
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
+
#ifdef LIBXML_ZLIB_ENABLED
#include <zlib.h>
#endif
diff --git a/trio.c b/trio.c
index ee270bc6..31b3b371 100644
--- a/trio.c
+++ b/trio.c
@@ -98,10 +98,7 @@
# include <stdarg.h>
#endif
#include <stddef.h>
-
-#if defined( HAVE_ERRNO_H ) || defined( __VMS )
#include <errno.h>
-#endif
#ifndef NULL
# define NULL 0
diff --git a/valid.c b/valid.c
index 25b90bca..16fa9238 100644
--- a/valid.c
+++ b/valid.c
@@ -11,10 +11,7 @@
#include "libxml.h"
#include <string.h>
-
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
#include <libxml/xmlmemory.h>
#include <libxml/hash.h>
diff --git a/vms/config.vms b/vms/config.vms
index 7f4342cd..1277114c 100755
--- a/vms/config.vms
+++ b/vms/config.vms
@@ -28,45 +28,18 @@
/* Define if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
-/* Define if you have the <ctype.h> header file. */
-#define HAVE_CTYPE_H 1
-
-/* Define if you have the <errno.h> header file. */
-#define HAVE_ERRNO_H 1
-
/* Define if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
-/* Define if you have the <float.h> header file. */
-#define HAVE_FLOAT_H 1
-
-/* Define if you have the <malloc.h> header file. */
-#undef HAVE_MALLOC_H
-
-/* Define if you have the <math.h> header file. */
-#define HAVE_MATH_H 1
-
/* Define if you have the <netdb.h> header file. */
#define HAVE_NETDB_H 1
/* Define if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
-/* Define if you have the <stdarg.h> header file. */
-#define HAVE_STDARG_H 1
-
-/* Define if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
/* Define to 1 if you have the `strftime' function. */
#define HAVE_STRFTIME 1
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
/* Define if you have the <sys/mman.h> header file. */
#undef HAVE_SYS_MMAN_H
@@ -85,9 +58,6 @@
/* Define if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
-/* Define if you have the <time.h> header file. */
-#define HAVE_TIME_H 1
-
/* Define if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
diff --git a/xlink.c b/xlink.c
index 0390a387..f93c9717 100644
--- a/xlink.c
+++ b/xlink.c
@@ -13,12 +13,9 @@
#ifdef LIBXML_XPTR_ENABLED
#include <string.h> /* for memset() only */
-#ifdef HAVE_CTYPE_H
#include <ctype.h>
-#endif
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
+
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
diff --git a/xmlIO.c b/xmlIO.c
index 59eb111f..a80ef11f 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -12,11 +12,8 @@
#include "libxml.h"
#include <string.h>
-#include <stddef.h>
-#ifdef HAVE_ERRNO_H
+#include <stdlib.h>
#include <errno.h>
-#endif
-
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -30,9 +27,6 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
#ifdef LIBXML_ZLIB_ENABLED
#include <zlib.h>
#endif
@@ -244,7 +238,6 @@ __xmlIOErr(int domain, int code, const char *extra)
unsigned int idx;
if (code == 0) {
-#ifdef HAVE_ERRNO_H
if (errno == 0) code = 0;
#ifdef EACCES
else if (errno == EACCES) code = XML_IO_EACCES;
@@ -400,7 +393,6 @@ __xmlIOErr(int domain, int code, const char *extra)
else if (errno == EAFNOSUPPORT) code = XML_IO_EAFNOSUPPORT;
#endif
else code = XML_IO_UNKNOWN;
-#endif /* HAVE_ERRNO_H */
}
idx = 0;
if (code >= XML_IO_UNKNOWN) idx = code - XML_IO_UNKNOWN;
diff --git a/xmlcatalog.c b/xmlcatalog.c
index 7b6f3769..d4143ad1 100644
--- a/xmlcatalog.c
+++ b/xmlcatalog.c
@@ -11,10 +11,7 @@
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
-
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
#ifdef HAVE_LIBREADLINE
#include <readline/readline.h>
diff --git a/xmllint.c b/xmllint.c
index 07d655b2..5dcb8840 100644
--- a/xmllint.c
+++ b/xmllint.c
@@ -10,19 +10,16 @@
#include <string.h>
#include <stdarg.h>
+#include <stdlib.h>
#include <assert.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_TIMEB_H
#include <sys/timeb.h>
#endif
-
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
@@ -42,9 +39,6 @@
#define MAP_FAILED ((void *) -1)
#endif
#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
#ifdef HAVE_LIBREADLINE
#include <readline/readline.h>
#ifdef HAVE_LIBHISTORY
@@ -445,16 +439,13 @@ endTimer(const char *fmt, ...)
msec *= 1000;
msec += (end.tv_usec - begin.tv_usec) / 1000;
-#ifndef HAVE_STDARG_H
-#error "endTimer required stdarg functions"
-#endif
va_start(ap, fmt);
vfprintf(stderr, fmt, 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
@@ -479,44 +470,11 @@ endTimer(const char *fmt, ...)
end = clock();
msec = ((end - begin) * 1000) / CLOCKS_PER_SEC;
-#ifndef HAVE_STDARG_H
-#error "endTimer required stdarg functions"
-#endif
va_start(ap, fmt);
vfprintf(stderr, fmt, 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 XMLCDECL LIBXML_ATTR_FORMAT(1,2)
-endTimer(char *format, ...)
-{
- /*
- * We cannot do anything because we don't have a timing function
- */
-#ifdef HAVE_STDARG_H
- va_list ap;
- 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
/************************************************************************
* *
diff --git a/xmlmemory.c b/xmlmemory.c
index ff500380..efee14dd 100644
--- a/xmlmemory.c
+++ b/xmlmemory.c
@@ -8,27 +8,14 @@
#include "libxml.h"
#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <time.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
-#ifdef HAVE_TIME_H
-#include <time.h>
-#endif
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#else
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-#endif
-
-#ifdef HAVE_CTYPE_H
-#include <ctype.h>
-#endif
-
/* #define DEBUG_MEMORY */
/**
@@ -963,9 +950,7 @@ xmlMemoryDump(void)
int
xmlInitMemory(void)
{
-#ifdef HAVE_STDLIB_H
char *breakpoint;
-#endif
#ifdef DEBUG_MEMORY
xmlGenericError(xmlGenericErrorContext,
"xmlInitMemory()\n");
@@ -978,18 +963,14 @@ xmlInitMemory(void)
xmlMemInitialized = 1;
xmlMemMutex = xmlNewMutex();
-#ifdef HAVE_STDLIB_H
breakpoint = getenv("XML_MEM_BREAKPOINT");
if (breakpoint != NULL) {
sscanf(breakpoint, "%ud", &xmlMemStopAtBlock);
}
-#endif
-#ifdef HAVE_STDLIB_H
breakpoint = getenv("XML_MEM_TRACE");
if (breakpoint != NULL) {
sscanf(breakpoint, "%p", &xmlMemTraceBlockAt);
}
-#endif
#ifdef DEBUG_MEMORY
xmlGenericError(xmlGenericErrorContext,
diff --git a/xmlreader.c b/xmlreader.c
index be3f6610..45062a47 100644
--- a/xmlreader.c
+++ b/xmlreader.c
@@ -20,13 +20,8 @@
#ifdef LIBXML_READER_ENABLED
#include <string.h> /* for memset() only ! */
#include <stdarg.h>
-
-#ifdef HAVE_CTYPE_H
#include <ctype.h>
-#endif
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
#include <libxml/xmlmemory.h>
#include <libxml/xmlIO.h>
diff --git a/xmlregexp.c b/xmlregexp.c
index 784563af..f9aac42f 100644
--- a/xmlregexp.c
+++ b/xmlregexp.c
@@ -23,9 +23,8 @@
#include <stdio.h>
#include <string.h>
-#ifdef HAVE_LIMITS_H
#include <limits.h>
-#endif
+
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
diff --git a/xmlschemastypes.c b/xmlschemastypes.c
index 64a3b3e0..419c1910 100644
--- a/xmlschemastypes.c
+++ b/xmlschemastypes.c
@@ -18,6 +18,9 @@
#ifdef LIBXML_SCHEMAS_ENABLED
#include <string.h>
+#include <math.h>
+#include <float.h>
+
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
#include <libxml/parserInternals.h>
@@ -30,13 +33,6 @@
#include <libxml/schemasInternals.h>
#include <libxml/xmlschemastypes.h>
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-#ifdef HAVE_FLOAT_H
-#include <float.h>
-#endif
-
#define DEBUG
#ifndef LIBXML_XPATH_ENABLED
diff --git a/xpath.c b/xpath.c
index 11b452e5..23078957 100644
--- a/xpath.c
+++ b/xpath.c
@@ -25,21 +25,12 @@
#include <limits.h>
#include <string.h>
#include <stddef.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_CTYPE_H
#include <ctype.h>
-#endif
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
#endif
#include <libxml/xmlmemory.h>
diff --git a/xzlib.c b/xzlib.c
index 62cb2b0f..c13e17db 100644
--- a/xzlib.c
+++ b/xzlib.c
@@ -11,10 +11,8 @@
#ifdef LIBXML_LZMA_ENABLED
#include <string.h>
-#ifdef HAVE_ERRNO_H
+#include <stdlib.h>
#include <errno.h>
-#endif
-
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -28,9 +26,6 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
#ifdef LIBXML_ZLIB_ENABLED
#include <zlib.h>
#endif