summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2022-09-02 05:03:03 +0200
committerNick Wellnhofer <wellnhofer@aevum.de>2022-09-02 18:33:36 +0200
commit5bffa33a1286518f04869359b996d220e8af9bd1 (patch)
treeda84293adcd7b2c1968f5c441424dcbfbf5c0314
parent05fc6ee27cc3c3daccf67cf78d3c2aa22dc0a6cb (diff)
downloadlibxml2-5bffa33a1286518f04869359b996d220e8af9bd1.tar.gz
Stop including sys/types.h
-rw-r--r--CMakeLists.txt9
-rw-r--r--catalog.c3
-rw-r--r--config.h.cmake.in3
-rw-r--r--configure.ac42
-rw-r--r--nanoftp.c3
-rw-r--r--nanohttp.c3
-rw-r--r--runsuite.c1
-rw-r--r--runtest.c1
-rw-r--r--runxmlconf.c1
-rw-r--r--testlimits.c1
-rw-r--r--testrecurse.c1
-rw-r--r--xmlIO.c3
-rw-r--r--xmllint.c3
-rw-r--r--xzlib.c3
14 files changed, 8 insertions, 69 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 175a5403..8d55f1d0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -154,8 +154,8 @@ if (NOT MSVC)
endif()
check_include_files(arpa/inet.h HAVE_ARPA_INET_H)
check_include_files(arpa/nameser.h HAVE_ARPA_NAMESER_H)
- check_struct_has_member("struct sockaddr_storage" ss_family "sys/socket.h;sys/types.h" HAVE_SS_FAMILY)
- check_struct_has_member("struct sockaddr_storage" __ss_family "sys/socket.h;sys/types.h" HAVE_BROKEN_SS_FAMILY)
+ check_struct_has_member("struct sockaddr_storage" ss_family "sys/socket.h" HAVE_SS_FAMILY)
+ check_struct_has_member("struct sockaddr_storage" __ss_family "sys/socket.h" HAVE_BROKEN_SS_FAMILY)
if(HAVE_BROKEN_SS_FAMILY)
set(ss_family __ss_family)
endif()
@@ -189,14 +189,12 @@ if (NOT MSVC)
check_include_files(sys/stat.h HAVE_SYS_STAT_H)
check_include_files(sys/timeb.h HAVE_SYS_TIMEB_H)
check_include_files(sys/time.h HAVE_SYS_TIME_H)
- check_include_files(sys/types.h HAVE_SYS_TYPES_H)
check_include_files(unistd.h HAVE_UNISTD_H)
check_function_exists(va_copy HAVE_VA_COPY)
check_function_exists(__va_copy HAVE___VA_COPY)
set(LT_OBJDIR ".libs/")
check_c_source_compiles("
#include <sys/socket.h>
- #include <sys/types.h>
int main() { (void) send(1, (const char*) \"\", 1, 1); return 0; }
" SEND_ARG2_CAST_CONST)
if(NOT SEND_ARG2_CAST_CONST)
@@ -217,7 +215,6 @@ if (NOT MSVC)
check_c_source_compiles("
#include <stddef.h>
#include <sys/socket.h>
- #include <sys/types.h>
int main() { (void) getsockopt(1, 1, 1, NULL, (socklen_t*) NULL); return 0; }
" XML_SOCKLEN_T_SOCKLEN_T)
if(XML_SOCKLEN_T_SOCKLEN_T)
@@ -226,7 +223,6 @@ if (NOT MSVC)
check_c_source_compiles("
#include <stddef.h>
#include <sys/socket.h>
- #include <sys/types.h>
int main() { (void) getsockopt(1, 1, 1, NULL, (size_t*) NULL); return 0; }
" XML_SOCKLEN_T_SIZE_T)
if(XML_SOCKLEN_T_SIZE_T)
@@ -235,7 +231,6 @@ if (NOT MSVC)
check_c_source_compiles("
#include <stddef.h>
#include <sys/socket.h>
- #include <sys/types.h>
int main() { (void) getsockopt (1, 1, 1, NULL, (int*) NULL); return 0; }
" XML_SOCKLEN_T_INT)
set(XML_SOCKLEN_T int)
diff --git a/catalog.c b/catalog.c
index 5b0013fc..369595a3 100644
--- a/catalog.c
+++ b/catalog.c
@@ -18,9 +18,6 @@
#ifdef LIBXML_CATALOG_ENABLED
#include <stdlib.h>
#include <string.h>
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
diff --git a/config.h.cmake.in b/config.h.cmake.in
index 1f8be710..b5268588 100644
--- a/config.h.cmake.in
+++ b/config.h.cmake.in
@@ -108,9 +108,6 @@
/* Define to 1 if you have the <sys/time.h> header file. */
#cmakedefine HAVE_SYS_TIME_H 1
-/* Define to 1 if you have the <sys/types.h> header file. */
-#cmakedefine HAVE_SYS_TYPES_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 a6fab769..a1140f22 100644
--- a/configure.ac
+++ b/configure.ac
@@ -289,42 +289,19 @@ dnl
AC_CHECK_HEADERS([fcntl.h])
AC_CHECK_HEADERS([unistd.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([sys/socket.h], [], [],
-[#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-# endif
-])
-AC_CHECK_HEADERS([netinet/in.h], [], [],
-[#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-# endif
-])
-AC_CHECK_HEADERS([arpa/inet.h], [], [],
-[#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-# endif
-#if HAVE_ARPA_INET_H
-# include <arpa/inet.h>
-# endif
-])
+AC_CHECK_HEADERS([sys/socket.h])
+AC_CHECK_HEADERS([netinet/in.h])
+AC_CHECK_HEADERS([arpa/inet.h])
AC_CHECK_HEADERS([netdb.h])
AC_CHECK_HEADERS([sys/time.h])
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([arpa/nameser.h], [], [],
-[#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-# endif
-])
-AC_CHECK_HEADERS([resolv.h], [], [],
-[#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-# endif
+AC_CHECK_HEADERS([arpa/nameser.h])
+AC_CHECK_HEADERS([resolv.h], [], [], [
#if HAVE_NETINET_IN_H
# include <netinet/in.h>
# endif
@@ -398,21 +375,18 @@ dnl Determine what socket length (socklen_t) data type is
AC_MSG_CHECKING([for type of socket length (socklen_t)])
AC_TRY_COMPILE2([
#include <stddef.h>
-#include <sys/types.h>
#include <sys/socket.h>],[
(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
AC_MSG_RESULT(socklen_t *)
XML_SOCKLEN_T=socklen_t],[
AC_TRY_COMPILE2([
#include <stddef.h>
-#include <sys/types.h>
#include <sys/socket.h>],[
(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
AC_MSG_RESULT(size_t *)
XML_SOCKLEN_T=size_t],[
AC_TRY_COMPILE2([
#include <stddef.h>
-#include <sys/types.h>
#include <sys/socket.h>],[
(void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
AC_MSG_RESULT(int *)
@@ -438,8 +412,7 @@ fi
dnl Checking if send() second argument is const.
AC_MSG_CHECKING([for const send() second argument])
-AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
-#include <sys/socket.h>]],
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]],
[[(void)send(1,(const char *)"",1,1);]])],
have_send_const_arg2=yes,
have_send_const_arg2=no)
@@ -464,7 +437,6 @@ fi
if test $enable_ipv6 = yes; then
have_ipv6=no
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-# include <sys/types.h>
# include <sys/socket.h>
]], [[
struct sockaddr_storage ss;
@@ -488,7 +460,6 @@ if test $enable_ipv6 = yes; then
dnl ********************************************************************
AC_MSG_CHECKING([struct sockaddr::ss_family])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-# include <sys/types.h>
# include <sys/socket.h>
]], [[
struct sockaddr_storage ss ;
@@ -501,7 +472,6 @@ if test $enable_ipv6 = yes; then
if test x$have_ss_family = xno ; then
AC_MSG_CHECKING([broken struct sockaddr::ss_family])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-# include <sys/types.h>
# include <sys/socket.h>
]], [[
struct sockaddr_storage ss ;
diff --git a/nanoftp.c b/nanoftp.c
index 009a8416..aaae2164 100644
--- a/nanoftp.c
+++ b/nanoftp.c
@@ -48,9 +48,6 @@
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
diff --git a/nanohttp.c b/nanohttp.c
index 3b1ecb0b..77fee197 100644
--- a/nanohttp.c
+++ b/nanohttp.c
@@ -22,9 +22,6 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
diff --git a/runsuite.c b/runsuite.c
index 483490a2..4e406a35 100644
--- a/runsuite.c
+++ b/runsuite.c
@@ -13,7 +13,6 @@
#include <unistd.h>
#endif
#include <string.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
diff --git a/runtest.c b/runtest.c
index 0b07c543..ff2e3c96 100644
--- a/runtest.c
+++ b/runtest.c
@@ -18,7 +18,6 @@
#include <unistd.h>
#endif
#include <string.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
diff --git a/runxmlconf.c b/runxmlconf.c
index 5e88f80d..69ce39fc 100644
--- a/runxmlconf.c
+++ b/runxmlconf.c
@@ -15,7 +15,6 @@
#include <unistd.h>
#endif
#include <string.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
diff --git a/testlimits.c b/testlimits.c
index a5ed231f..6322f8ba 100644
--- a/testlimits.c
+++ b/testlimits.c
@@ -17,7 +17,6 @@
#include <unistd.h>
#endif
#include <string.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>
diff --git a/testrecurse.c b/testrecurse.c
index fabc5138..d213ebc6 100644
--- a/testrecurse.c
+++ b/testrecurse.c
@@ -17,7 +17,6 @@
#include <unistd.h>
#endif
#include <string.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
diff --git a/xmlIO.c b/xmlIO.c
index ab3b15b3..834b4ae5 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -15,9 +15,6 @@
#include <stdlib.h>
#include <errno.h>
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
diff --git a/xmllint.c b/xmllint.c
index 5ef8c64f..02042382 100644
--- a/xmllint.c
+++ b/xmllint.c
@@ -20,9 +20,6 @@
#ifdef HAVE_SYS_TIMEB_H
#include <sys/timeb.h>
#endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
diff --git a/xzlib.c b/xzlib.c
index 803519ad..a07b3c88 100644
--- a/xzlib.c
+++ b/xzlib.c
@@ -14,9 +14,6 @@
#include <stdlib.h>
#include <errno.h>
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif