From: Viktor Szakats Date: Wed, 11 Jun 2025 05:32:16 +0000 (+0200) Subject: build: drop `HAVE_SYS_SOCKET_H` and `HAVE_SYS_TIME_H` macros X-Git-Tag: curl-8_15_0~261 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3186a20483b4c829cb211d48393285ecc95c4273;p=thirdparty%2Fcurl.git build: drop `HAVE_SYS_SOCKET_H` and `HAVE_SYS_TIME_H` macros Both are available with well-known conditions, under non-Windows, and `curl/curl.h` already uses them. `sys/time.h` is also necessary for mingw-w64 for `gettimeofday()`. Follow-up to 56d5982312f8360b020738cbfeefe7990991550e #17522 Closes #17581 --- diff --git a/CMake/CurlTests.c b/CMake/CurlTests.c index de2313080d..410a0f70ce 100644 --- a/CMake/CurlTests.c +++ b/CMake/CurlTests.c @@ -203,7 +203,7 @@ int main(void) #ifdef HAVE_UNISTD_H # include #endif -#ifdef HAVE_SYS_SOCKET_H +#ifndef _WIN32 # include #endif #ifdef HAVE_SYS_IOCTL_H @@ -230,7 +230,7 @@ int main(void) #ifdef HAVE_UNISTD_H # include #endif -#ifdef HAVE_SYS_SOCKET_H +#ifndef _WIN32 # include #endif #ifdef HAVE_SYS_IOCTL_H @@ -257,7 +257,7 @@ int main(void) #ifdef HAVE_SYS_TYPES_H # include #endif -#ifdef HAVE_SYS_SOCKET_H +#ifndef _WIN32 # include #endif int main(void) diff --git a/CMake/OtherTests.cmake b/CMake/OtherTests.cmake index 0ccda61de6..9f59e0dc81 100644 --- a/CMake/OtherTests.cmake +++ b/CMake/OtherTests.cmake @@ -42,7 +42,7 @@ if(NOT DEFINED HAVE_STRUCT_SOCKADDR_STORAGE) if(WIN32) set(CMAKE_EXTRA_INCLUDE_FILES "winsock2.h") list(APPEND CMAKE_REQUIRED_LIBRARIES "ws2_32") - elseif(HAVE_SYS_SOCKET_H) + else() set(CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h") endif() check_type_size("struct sockaddr_storage" SIZEOF_STRUCT_SOCKADDR_STORAGE) @@ -53,8 +53,8 @@ endif() if(NOT WIN32) set(_source_epilogue "#undef inline") curl_add_header_include(HAVE_SYS_TYPES_H "sys/types.h") - curl_add_header_include(HAVE_SYS_SOCKET_H "sys/socket.h") check_c_source_compiles("${_source_epilogue} + #include int main(void) { int flag = MSG_NOSIGNAL; @@ -64,11 +64,13 @@ if(NOT WIN32) endif() set(_source_epilogue "#undef inline") -curl_add_header_include(HAVE_SYS_TIME_H "sys/time.h") check_c_source_compiles("${_source_epilogue} #ifdef _MSC_VER #include #endif + #ifndef _WIN32 + #include + #endif #include int main(void) { @@ -101,9 +103,11 @@ elseif(BSD OR CMAKE_SYSTEM_NAME MATCHES "BSD") endif() if(NOT DEFINED HAVE_GETADDRINFO_THREADSAFE) - set(_source_epilogue "#undef inline") - curl_add_header_include(HAVE_SYS_SOCKET_H "sys/socket.h") - curl_add_header_include(HAVE_SYS_TIME_H "sys/time.h") + set(_source_epilogue "#undef inline + #ifndef _WIN32 + #include + #include + #endif") curl_add_header_include(HAVE_NETDB_H "netdb.h") check_c_source_compiles("${_source_epilogue} int main(void) @@ -144,8 +148,8 @@ endif() if(NOT WIN32 AND NOT DEFINED HAVE_CLOCK_GETTIME_MONOTONIC_RAW) set(_source_epilogue "#undef inline") curl_add_header_include(HAVE_SYS_TYPES_H "sys/types.h") - curl_add_header_include(HAVE_SYS_TIME_H "sys/time.h") check_c_source_compiles("${_source_epilogue} + #include #include int main(void) { diff --git a/CMake/unix-cache.cmake b/CMake/unix-cache.cmake index 3efad438dc..2f0da66755 100644 --- a/CMake/unix-cache.cmake +++ b/CMake/unix-cache.cmake @@ -287,7 +287,6 @@ else() set(HAVE_SYS_SOCKIO_H 1) endif() set(HAVE_SYS_STAT_H 1) -set(HAVE_SYS_TIME_H 1) set(HAVE_SYS_TYPES_H 1) set(HAVE_SYS_UN_H 1) if(CYGWIN) diff --git a/CMakeLists.txt b/CMakeLists.txt index 582222a7be..3730488cfd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1618,17 +1618,12 @@ if(WIN32) set(HAVE_IF_NAMETOINDEX 0) endif() unset(HAVE_IF_NAMETOINDEX CACHE) - - set(HAVE_SYS_TIME_H ${MINGW}) -else() - set(HAVE_SYS_SOCKET_H 1) - set(HAVE_SYS_TIME_H 1) endif() -if(HAVE_SYS_SOCKET_H) +if(NOT WIN32) list(APPEND CURL_INCLUDES "sys/socket.h") endif() -if(HAVE_SYS_TIME_H) +if(NOT WIN32 OR MINGW) list(APPEND CURL_INCLUDES "sys/time.h") endif() @@ -1687,7 +1682,6 @@ foreach(_variable IN ITEMS HAVE_STDBOOL_H HAVE_STROPTS_H HAVE_SYS_IOCTL_H - HAVE_SYS_SOCKET_H HAVE_SYS_TYPES_H HAVE_UNISTD_H ) @@ -1832,7 +1826,7 @@ if(WIN32) list(APPEND CMAKE_EXTRA_INCLUDE_FILES "winsock2.h") check_type_size("ADDRESS_FAMILY" SIZEOF_ADDRESS_FAMILY) set(HAVE_ADDRESS_FAMILY ${HAVE_SIZEOF_ADDRESS_FAMILY}) -elseif(HAVE_SYS_SOCKET_H) +else() list(APPEND CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h") check_type_size("sa_family_t" SIZEOF_SA_FAMILY_T) set(HAVE_SA_FAMILY_T ${HAVE_SIZEOF_SA_FAMILY_T}) diff --git a/acinclude.m4 b/acinclude.m4 index 53c302cc03..e10e4a01e0 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -600,9 +600,7 @@ AC_DEFUN([TYPE_SOCKADDR_STORAGE], #ifdef HAVE_SYS_TYPES_H #include #endif - #ifdef HAVE_SYS_SOCKET_H #include - #endif #ifdef HAVE_NETINET_IN_H #include #endif @@ -620,7 +618,7 @@ dnl Test if the socket recv() function is available, AC_DEFUN([CURL_CHECK_FUNC_RECV], [ AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])dnl - AC_CHECK_HEADERS(sys/types.h sys/socket.h) + AC_CHECK_HEADERS(sys/types.h) # AC_MSG_CHECKING([for recv]) AC_LINK_IFELSE([ @@ -636,10 +634,8 @@ AC_DEFUN([CURL_CHECK_FUNC_RECV], [ #ifdef HAVE_SYS_TYPES_H #include #endif - #ifdef HAVE_SYS_SOCKET_H #include #endif - #endif ]],[[ recv(0, 0, 0, 0); ]]) @@ -668,7 +664,7 @@ dnl Test if the socket send() function is available, AC_DEFUN([CURL_CHECK_FUNC_SEND], [ AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])dnl - AC_CHECK_HEADERS(sys/types.h sys/socket.h) + AC_CHECK_HEADERS(sys/types.h) # AC_MSG_CHECKING([for send]) AC_LINK_IFELSE([ @@ -684,10 +680,8 @@ AC_DEFUN([CURL_CHECK_FUNC_SEND], [ #ifdef HAVE_SYS_TYPES_H #include #endif - #ifdef HAVE_SYS_SOCKET_H #include #endif - #endif ]],[[ char s[] = ""; send(0, (void *)s, 0, 0); @@ -714,7 +708,7 @@ dnl ------------------------------------------------- dnl Check for MSG_NOSIGNAL AC_DEFUN([CURL_CHECK_MSG_NOSIGNAL], [ - AC_CHECK_HEADERS(sys/types.h sys/socket.h) + AC_CHECK_HEADERS(sys/types.h) AC_CACHE_CHECK([for MSG_NOSIGNAL], [curl_cv_msg_nosignal], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ @@ -728,10 +722,8 @@ AC_DEFUN([CURL_CHECK_MSG_NOSIGNAL], [ #ifdef HAVE_SYS_TYPES_H #include #endif - #ifdef HAVE_SYS_SOCKET_H #include #endif - #endif ]],[[ int flag = MSG_NOSIGNAL; (void)flag; @@ -757,7 +749,7 @@ dnl Check for timeval struct AC_DEFUN([CURL_CHECK_STRUCT_TIMEVAL], [ AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl - AC_CHECK_HEADERS(sys/types.h sys/time.h sys/socket.h) + AC_CHECK_HEADERS(sys/types.h) AC_CACHE_CHECK([for struct timeval], [curl_cv_struct_timeval], [ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ @@ -767,17 +759,14 @@ AC_DEFUN([CURL_CHECK_STRUCT_TIMEVAL], [ #define WIN32_LEAN_AND_MEAN #endif #include + #else + #include + #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif - #ifdef HAVE_SYS_TIME_H - #include - #endif #include - #ifdef HAVE_SYS_SOCKET_H - #include - #endif ]],[[ struct timeval ts; ts.tv_sec = 0; @@ -804,7 +793,7 @@ dnl ------------------------------------------------- dnl Check if monotonic clock_gettime is available. AC_DEFUN([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC], [ - AC_CHECK_HEADERS(sys/types.h sys/time.h) + AC_CHECK_HEADERS(sys/types.h) AC_MSG_CHECKING([for monotonic clock_gettime]) # @@ -813,7 +802,7 @@ AC_DEFUN([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC], [ #ifdef HAVE_SYS_TYPES_H #include #endif - #ifdef HAVE_SYS_TIME_H + #ifndef _WIN32 #include #endif #include @@ -839,7 +828,7 @@ dnl ------------------------------------------------- dnl Check if monotonic clock_gettime is available. AC_DEFUN([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC_RAW], [ - AC_CHECK_HEADERS(sys/types.h sys/time.h) + AC_CHECK_HEADERS(sys/types.h) AC_MSG_CHECKING([for raw monotonic clock_gettime]) # AC_COMPILE_IFELSE([ @@ -847,7 +836,7 @@ AC_DEFUN([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC_RAW], [ #ifdef HAVE_SYS_TYPES_H #include #endif - #ifdef HAVE_SYS_TIME_H + #ifndef _WIN32 #include #endif #include @@ -893,7 +882,7 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [ #ifdef HAVE_SYS_TYPES_H #include #endif - #ifdef HAVE_SYS_TIME_H + #ifndef _WIN32 #include #endif #include @@ -946,7 +935,7 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [ #ifdef HAVE_SYS_TYPES_H #include #endif - #ifdef HAVE_SYS_TIME_H + #ifndef _WIN32 #include #endif #include @@ -1034,7 +1023,7 @@ dnl Test if the socket select() function is available. AC_DEFUN([CURL_CHECK_FUNC_SELECT], [ AC_REQUIRE([CURL_CHECK_STRUCT_TIMEVAL])dnl AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])dnl - AC_CHECK_HEADERS(sys/select.h sys/socket.h) + AC_CHECK_HEADERS(sys/select.h) # AC_MSG_CHECKING([for select]) AC_LINK_IFELSE([ @@ -1045,13 +1034,13 @@ AC_DEFUN([CURL_CHECK_FUNC_SELECT], [ #define WIN32_LEAN_AND_MEAN #endif #include + #else + #include + #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif - #ifdef HAVE_SYS_TIME_H - #include - #endif #include #ifndef _WIN32 #ifdef HAVE_SYS_SELECT_H @@ -1059,9 +1048,6 @@ AC_DEFUN([CURL_CHECK_FUNC_SELECT], [ #elif defined(HAVE_UNISTD_H) #include #endif - #ifdef HAVE_SYS_SOCKET_H - #include - #endif $curl_includes_bsdsocket #endif ]],[[ diff --git a/configure.ac b/configure.ac index 3926cf3c4a..adffb9bb5c 100644 --- a/configure.ac +++ b/configure.ac @@ -3914,13 +3914,6 @@ case "$OPT_FISH_FPATH" in esac AM_CONDITIONAL(USE_FISH_COMPLETION, test x"$FISH_FUNCTIONS_DIR" != x) -if test "$curl_cv_native_windows" != 'yes'; then - AC_DEFINE(HAVE_SYS_SOCKET_H, 1, [if you have ]) - AC_DEFINE(HAVE_SYS_TIME_H, 1, [if you have ]) - HAVE_SYS_SOCKET_H=1 - HAVE_SYS_TIME_H=1 -fi - dnl Now check for the very most basic headers. Then we can use these dnl ones as default-headers when checking for the rest! AC_CHECK_HEADERS( @@ -3966,7 +3959,7 @@ dnl default includes #ifdef HAVE_SYS_TYPES_H #include #endif -#ifdef HAVE_SYS_TIME_H +#if !defined(_WIN32) || defined(__MINGW32__) #include #endif #ifdef HAVE_SYS_SELECT_H @@ -3974,7 +3967,7 @@ dnl default includes #elif defined(HAVE_UNISTD_H) #include #endif -#ifdef HAVE_SYS_SOCKET_H +#ifndef _WIN32 #include #endif #ifdef HAVE_NETINET_IN_H @@ -4054,14 +4047,13 @@ AC_CHECK_TYPE(sa_family_t, #define WIN32_LEAN_AND_MEAN #endif #include -#endif -#ifdef HAVE_SYS_SOCKET_H +#else #include #endif ]) ], [ -#ifdef HAVE_SYS_SOCKET_H +#ifndef _WIN32 #include #endif ]) @@ -4074,7 +4066,7 @@ AC_CHECK_TYPE([suseconds_t],[ #ifdef HAVE_SYS_TYPES_H #include #endif -#ifdef HAVE_SYS_TIME_H +#ifndef _WIN32 #include #endif ]) diff --git a/lib/config-mac.h b/lib/config-mac.h index 1a902b89f5..435e1293e0 100644 --- a/lib/config-mac.h +++ b/lib/config-mac.h @@ -43,7 +43,6 @@ #define USE_MANUAL 1 #define HAVE_NETINET_IN_H 1 -#define HAVE_SYS_SOCKET_H 1 #define HAVE_NETDB_H 1 #define HAVE_ARPA_INET_H 1 #define HAVE_UNISTD_H 1 @@ -53,7 +52,6 @@ #define HAVE_FCNTL_H 1 #define HAVE_SYS_STAT_H 1 #define HAVE_UTIME_H 1 -#define HAVE_SYS_TIME_H 1 #define HAVE_SYS_UTIME_H 1 #define HAVE_SYS_IOCTL_H 1 #define HAVE_ALARM 1 diff --git a/lib/config-os400.h b/lib/config-os400.h index 4316c58acd..ec7fc9129d 100644 --- a/lib/config-os400.h +++ b/lib/config-os400.h @@ -158,18 +158,12 @@ /* Define if you have the header file. */ #undef HAVE_SYS_SELECT_H -/* Define if you have the header file. */ -#define HAVE_SYS_SOCKET_H - /* Define if you have the header file. */ #undef HAVE_SYS_SOCKIO_H /* Define if you have the header file. */ #define HAVE_SYS_STAT_H -/* Define if you have the header file. */ -#define HAVE_SYS_TIME_H - /* Define if you have the header file. */ #define HAVE_SYS_TYPES_H diff --git a/lib/config-plan9.h b/lib/config-plan9.h index 857b786648..8d19925993 100644 --- a/lib/config-plan9.h +++ b/lib/config-plan9.h @@ -113,9 +113,7 @@ #define HAVE_SYS_IOCTL_H 1 #define HAVE_SYS_PARAM_H 1 #define HAVE_SYS_RESOURCE_H 1 -#define HAVE_SYS_SOCKET_H 1 #define HAVE_SYS_STAT_H 1 -#define HAVE_SYS_TIME_H 1 #define HAVE_SYS_TYPES_H 1 #define HAVE_SYS_UN_H 1 #define HAVE_TERMIOS_H 1 diff --git a/lib/config-riscos.h b/lib/config-riscos.h index f78ca2d496..03a3cde074 100644 --- a/lib/config-riscos.h +++ b/lib/config-riscos.h @@ -144,18 +144,12 @@ /* Define if you have the header file. */ #undef HAVE_SYS_SELECT_H -/* Define if you have the header file. */ -#define HAVE_SYS_SOCKET_H - /* Define if you have the header file. */ #undef HAVE_SYS_SOCKIO_H /* Define if you have the header file. */ #undef HAVE_SYS_STAT_H -/* Define if you have the header file. */ -#define HAVE_SYS_TIME_H - /* Define if you have the header file. */ #define HAVE_SYS_TYPES_H diff --git a/lib/config-win32.h b/lib/config-win32.h index c9ba42762d..176f65a3b7 100644 --- a/lib/config-win32.h +++ b/lib/config-win32.h @@ -74,20 +74,12 @@ /* Define if you have the header file. */ /* #define HAVE_SYS_SELECT_H 1 */ -/* Define if you have the header file. */ -/* #define HAVE_SYS_SOCKET_H 1 */ - /* Define if you have the header file. */ /* #define HAVE_SYS_SOCKIO_H 1 */ /* Define if you have the header file. */ #define HAVE_SYS_STAT_H 1 -/* Define if you have the header file. */ -#ifdef __MINGW32__ -#define HAVE_SYS_TIME_H 1 -#endif - /* Define if you have the header file. */ #define HAVE_SYS_TYPES_H 1 diff --git a/lib/curl_config.h.cmake b/lib/curl_config.h.cmake index fa0cca55c8..3a9abaf1e9 100644 --- a/lib/curl_config.h.cmake +++ b/lib/curl_config.h.cmake @@ -586,18 +586,12 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_SELECT_H 1 -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYS_SOCKET_H 1 - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_SOCKIO_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_STAT_H 1 -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYS_TIME_H 1 - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_TYPES_H 1 diff --git a/lib/curl_setup_once.h b/lib/curl_setup_once.h index c1051e0fae..c5d56301c5 100644 --- a/lib/curl_setup_once.h +++ b/lib/curl_setup_once.h @@ -45,7 +45,7 @@ #include #endif -#ifdef HAVE_SYS_TIME_H +#if !defined(_WIN32) || defined(__MINGW32__) #include #endif @@ -96,7 +96,7 @@ # endif #endif -#ifdef HAVE_SYS_SOCKET_H +#ifndef _WIN32 #include #endif diff --git a/lib/curlx/inet_ntop.h b/lib/curlx/inet_ntop.h index 41ec909718..68f8c8d132 100644 --- a/lib/curlx/inet_ntop.h +++ b/lib/curlx/inet_ntop.h @@ -32,7 +32,7 @@ char *curlx_inet_ntop(int af, const void *addr, char *buf, size_t size); #ifdef HAVE_NETINET_IN_H #include #endif -#ifdef HAVE_SYS_SOCKET_H +#ifndef _WIN32 #include #endif #ifdef HAVE_ARPA_INET_H diff --git a/lib/curlx/inet_pton.h b/lib/curlx/inet_pton.h index a9dc43085f..610b329f51 100644 --- a/lib/curlx/inet_pton.h +++ b/lib/curlx/inet_pton.h @@ -32,7 +32,7 @@ int curlx_inet_pton(int, const char *, void *); #ifdef HAVE_NETINET_IN_H #include #endif -#ifdef HAVE_SYS_SOCKET_H +#ifndef _WIN32 #include #endif #ifdef HAVE_ARPA_INET_H diff --git a/lib/setup-win32.h b/lib/setup-win32.h index 35fe513a84..f95eacf62b 100644 --- a/lib/setup-win32.h +++ b/lib/setup-win32.h @@ -30,10 +30,10 @@ /* ---------------------------------------------------------------- */ #ifdef USE_WATT32 # include +# include # undef byte # undef word # define HAVE_SYS_IOCTL_H -# define HAVE_SYS_SOCKET_H # define HAVE_NETINET_IN_H # define HAVE_NETDB_H # define HAVE_ARPA_INET_H diff --git a/m4/curl-functions.m4 b/m4/curl-functions.m4 index 79bb0ab746..2818263b88 100644 --- a/m4/curl-functions.m4 +++ b/m4/curl-functions.m4 @@ -37,9 +37,6 @@ curl_includes_arpa_inet="\ #ifdef HAVE_SYS_TYPES_H # include #endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif @@ -49,10 +46,12 @@ curl_includes_arpa_inet="\ #ifdef _WIN32 #include #include +#else +#include #endif /* includes end */" AC_CHECK_HEADERS( - sys/types.h sys/socket.h netinet/in.h arpa/inet.h, + sys/types.h netinet/in.h arpa/inet.h, [], [], [$curl_includes_arpa_inet]) ]) @@ -92,7 +91,7 @@ curl_includes_ifaddrs="\ #ifdef HAVE_SYS_TYPES_H # include #endif -#ifdef HAVE_SYS_SOCKET_H +#ifndef _WIN32 # include #endif #ifdef HAVE_NETINET_IN_H @@ -103,7 +102,7 @@ curl_includes_ifaddrs="\ #endif /* includes end */" AC_CHECK_HEADERS( - sys/types.h sys/socket.h netinet/in.h ifaddrs.h, + sys/types.h netinet/in.h ifaddrs.h, [], [], [$curl_includes_ifaddrs]) ]) @@ -243,7 +242,7 @@ curl_includes_stropts="\ #ifdef HAVE_UNISTD_H # include #endif -#ifdef HAVE_SYS_SOCKET_H +#ifndef _WIN32 # include #endif #ifdef HAVE_SYS_IOCTL_H @@ -254,7 +253,7 @@ curl_includes_stropts="\ #endif /* includes end */" AC_CHECK_HEADERS( - sys/types.h unistd.h sys/socket.h sys/ioctl.h stropts.h, + sys/types.h unistd.h sys/ioctl.h stropts.h, [], [], [$curl_includes_stropts]) ]) @@ -270,12 +269,12 @@ curl_includes_sys_socket="\ #ifdef HAVE_SYS_TYPES_H # include #endif -#ifdef HAVE_SYS_SOCKET_H +#ifndef _WIN32 # include #endif /* includes end */" AC_CHECK_HEADERS( - sys/types.h sys/socket.h, + sys/types.h, [], [], [$curl_includes_sys_socket]) ]) @@ -329,13 +328,13 @@ curl_includes_time="\ #ifdef HAVE_SYS_TYPES_H # include #endif -#ifdef HAVE_SYS_TIME_H +#if !defined(_WIN32) || defined(__MINGW32__) # include #endif #include /* includes end */" AC_CHECK_HEADERS( - sys/types.h sys/time.h, + sys/types.h, [], [], [$curl_includes_time]) ]) diff --git a/tests/libtest/lib1960.c b/tests/libtest/lib1960.c index 7b6a72df25..9aaf20e341 100644 --- a/tests/libtest/lib1960.c +++ b/tests/libtest/lib1960.c @@ -28,7 +28,7 @@ #ifdef HAVE_NETINET_IN_H #include #endif -#ifdef HAVE_SYS_SOCKET_H +#ifndef _WIN32 #include #endif #ifdef HAVE_ARPA_INET_H