]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
build: drop `HAVE_SYS_SOCKET_H` and `HAVE_SYS_TIME_H` macros
authorViktor Szakats <commit@vsz.me>
Wed, 11 Jun 2025 05:32:16 +0000 (07:32 +0200)
committerViktor Szakats <commit@vsz.me>
Sun, 15 Jun 2025 16:44:39 +0000 (18:44 +0200)
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

18 files changed:
CMake/CurlTests.c
CMake/OtherTests.cmake
CMake/unix-cache.cmake
CMakeLists.txt
acinclude.m4
configure.ac
lib/config-mac.h
lib/config-os400.h
lib/config-plan9.h
lib/config-riscos.h
lib/config-win32.h
lib/curl_config.h.cmake
lib/curl_setup_once.h
lib/curlx/inet_ntop.h
lib/curlx/inet_pton.h
lib/setup-win32.h
m4/curl-functions.m4
tests/libtest/lib1960.c

index de2313080dd72c142d4aac932a63577be7390089..410a0f70ce90408652b7bd99da6c5df4da7722a8 100644 (file)
@@ -203,7 +203,7 @@ int main(void)
 #ifdef HAVE_UNISTD_H
 #  include <unistd.h>
 #endif
-#ifdef HAVE_SYS_SOCKET_H
+#ifndef _WIN32
 #  include <sys/socket.h>
 #endif
 #ifdef HAVE_SYS_IOCTL_H
@@ -230,7 +230,7 @@ int main(void)
 #ifdef HAVE_UNISTD_H
 #  include <unistd.h>
 #endif
-#ifdef HAVE_SYS_SOCKET_H
+#ifndef _WIN32
 #  include <sys/socket.h>
 #endif
 #ifdef HAVE_SYS_IOCTL_H
@@ -257,7 +257,7 @@ int main(void)
 #ifdef HAVE_SYS_TYPES_H
 #  include <sys/types.h>
 #endif
-#ifdef HAVE_SYS_SOCKET_H
+#ifndef _WIN32
 #  include <sys/socket.h>
 #endif
 int main(void)
index 0ccda61de65b22a653703ce79ca1bb3604a414e0..9f59e0dc8109d7907e92be77a28c1d73ec76f5ec 100644 (file)
@@ -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 <sys/socket.h>
     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 <winsock2.h>
   #endif
+  #ifndef _WIN32
+  #include <sys/time.h>
+  #endif
   #include <time.h>
   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 <sys/socket.h>
+    #include <sys/time.h>
+    #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 <sys/time.h>
     #include <time.h>
     int main(void)
     {
index 3efad438dc44373193aae769c4d6c1ad520e8b14..2f0da667552ea15ad38a03c763e2d1878c98d861 100644 (file)
@@ -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)
index 582222a7be8b9c495760382eb2e93db317089c11..3730488cfd93506fe5041d9a6e0b853a97755035 100644 (file)
@@ -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})
index 53c302cc03a75f8399584b8305b30eda21dd8de9..e10e4a01e0407a8cb8be584cfff73bc2e3f3cc50 100644 (file)
@@ -600,9 +600,7 @@ AC_DEFUN([TYPE_SOCKADDR_STORAGE],
      #ifdef HAVE_SYS_TYPES_H
      #include <sys/types.h>
      #endif
-     #ifdef HAVE_SYS_SOCKET_H
      #include <sys/socket.h>
-     #endif
      #ifdef HAVE_NETINET_IN_H
      #include <netinet/in.h>
      #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 <sys/types.h>
       #endif
-      #ifdef HAVE_SYS_SOCKET_H
       #include <sys/socket.h>
       #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 <sys/types.h>
       #endif
-      #ifdef HAVE_SYS_SOCKET_H
       #include <sys/socket.h>
       #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 <sys/types.h>
         #endif
-        #ifdef HAVE_SYS_SOCKET_H
         #include <sys/socket.h>
         #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 <winsock2.h>
+        #else
+        #include <sys/socket.h>
+        #include <sys/time.h>
         #endif
         #ifdef HAVE_SYS_TYPES_H
         #include <sys/types.h>
         #endif
-        #ifdef HAVE_SYS_TIME_H
-        #include <sys/time.h>
-        #endif
         #include <time.h>
-        #ifdef HAVE_SYS_SOCKET_H
-        #include <sys/socket.h>
-        #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 <sys/types.h>
       #endif
-      #ifdef HAVE_SYS_TIME_H
+      #ifndef _WIN32
       #include <sys/time.h>
       #endif
       #include <time.h>
@@ -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 <sys/types.h>
       #endif
-      #ifdef HAVE_SYS_TIME_H
+      #ifndef _WIN32
       #include <sys/time.h>
       #endif
       #include <time.h>
@@ -893,7 +882,7 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [
             #ifdef HAVE_SYS_TYPES_H
             #include <sys/types.h>
             #endif
-            #ifdef HAVE_SYS_TIME_H
+            #ifndef _WIN32
             #include <sys/time.h>
             #endif
             #include <time.h>
@@ -946,7 +935,7 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [
           #ifdef HAVE_SYS_TYPES_H
           #include <sys/types.h>
           #endif
-          #ifdef HAVE_SYS_TIME_H
+          #ifndef _WIN32
           #include <sys/time.h>
           #endif
           #include <time.h>
@@ -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 <winsock2.h>
+      #else
+      #include <sys/socket.h>
+      #include <sys/time.h>
       #endif
       #ifdef HAVE_SYS_TYPES_H
       #include <sys/types.h>
       #endif
-      #ifdef HAVE_SYS_TIME_H
-      #include <sys/time.h>
-      #endif
       #include <time.h>
       #ifndef _WIN32
       #ifdef HAVE_SYS_SELECT_H
@@ -1059,9 +1048,6 @@ AC_DEFUN([CURL_CHECK_FUNC_SELECT], [
       #elif defined(HAVE_UNISTD_H)
       #include <unistd.h>
       #endif
-      #ifdef HAVE_SYS_SOCKET_H
-      #include <sys/socket.h>
-      #endif
       $curl_includes_bsdsocket
       #endif
     ]],[[
index 3926cf3c4acd7fdba902a1bea19c4c3aff293991..adffb9bb5c15e65448cba178fbe312c77e425216 100644 (file)
@@ -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 <sys/socket.h>])
-  AC_DEFINE(HAVE_SYS_TIME_H, 1, [if you have <sys/time.h>])
-  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 <sys/types.h>
 #endif
-#ifdef HAVE_SYS_TIME_H
+#if !defined(_WIN32) || defined(__MINGW32__)
 #include <sys/time.h>
 #endif
 #ifdef HAVE_SYS_SELECT_H
@@ -3974,7 +3967,7 @@ dnl default includes
 #elif defined(HAVE_UNISTD_H)
 #include <unistd.h>
 #endif
-#ifdef HAVE_SYS_SOCKET_H
+#ifndef _WIN32
 #include <sys/socket.h>
 #endif
 #ifdef HAVE_NETINET_IN_H
@@ -4054,14 +4047,13 @@ AC_CHECK_TYPE(sa_family_t,
 #define WIN32_LEAN_AND_MEAN
 #endif
 #include <winsock2.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
+#else
 #include <sys/socket.h>
 #endif
     ])
   ],
 [
-#ifdef HAVE_SYS_SOCKET_H
+#ifndef _WIN32
 #include <sys/socket.h>
 #endif
 ])
@@ -4074,7 +4066,7 @@ AC_CHECK_TYPE([suseconds_t],[
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
-#ifdef HAVE_SYS_TIME_H
+#ifndef _WIN32
 #include <sys/time.h>
 #endif
 ])
index 1a902b89f5f1a5ca5d23983f87c0b340ce870f68..435e1293e036b15233b223e66fcefe8c07d1c5b2 100644 (file)
@@ -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
index 4316c58acd9cd1e5400e60caefcb5a36df581fb6..ec7fc9129d92546cdcd7f16931edb4268b75b0eb 100644 (file)
 /* Define if you have the <sys/select.h> header file. */
 #undef HAVE_SYS_SELECT_H
 
-/* Define if you have the <sys/socket.h> header file. */
-#define HAVE_SYS_SOCKET_H
-
 /* Define if you have the <sys/sockio.h> header file. */
 #undef HAVE_SYS_SOCKIO_H
 
 /* Define if you have the <sys/stat.h> header file. */
 #define HAVE_SYS_STAT_H
 
-/* Define if you have the <sys/time.h> header file. */
-#define HAVE_SYS_TIME_H
-
 /* Define if you have the <sys/types.h> header file. */
 #define HAVE_SYS_TYPES_H
 
index 857b7866489ba88359f1cb0f2dbc81b8615fc6dc..8d19925993d199bdc6690d0cc2405dea61948f8a 100644 (file)
 #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
index f78ca2d496c9f5d0156382f1bc0ee1971822be48..03a3cde074d8ce576f4a5080eff20d583b3ce0d8 100644 (file)
 /* Define if you have the <sys/select.h> header file. */
 #undef HAVE_SYS_SELECT_H
 
-/* Define if you have the <sys/socket.h> header file. */
-#define HAVE_SYS_SOCKET_H
-
 /* Define if you have the <sys/sockio.h> header file. */
 #undef HAVE_SYS_SOCKIO_H
 
 /* Define if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define if you have the <sys/time.h> header file. */
-#define HAVE_SYS_TIME_H
-
 /* Define if you have the <sys/types.h> header file. */
 #define HAVE_SYS_TYPES_H
 
index c9ba42762d6ffffe8c537773351cf9dda2dcbd1a..176f65a3b73379bb22827d3a0a64c651cc869ab0 100644 (file)
 /* Define if you have the <sys/select.h> header file. */
 /* #define HAVE_SYS_SELECT_H 1 */
 
-/* Define if you have the <sys/socket.h> header file. */
-/* #define HAVE_SYS_SOCKET_H 1 */
-
 /* Define if you have the <sys/sockio.h> header file. */
 /* #define HAVE_SYS_SOCKIO_H 1 */
 
 /* Define if you have the <sys/stat.h> header file. */
 #define HAVE_SYS_STAT_H 1
 
-/* Define if you have the <sys/time.h> header file. */
-#ifdef __MINGW32__
-#define HAVE_SYS_TIME_H 1
-#endif
-
 /* Define if you have the <sys/types.h> header file. */
 #define HAVE_SYS_TYPES_H 1
 
index fa0cca55c807efa4985f74229f98b8e203c28bd2..3a9abaf1e9bae39d58b558ee090cf1dbec1a8456 100644 (file)
 /* Define to 1 if you have the <sys/select.h> header file. */
 #cmakedefine HAVE_SYS_SELECT_H 1
 
-/* Define to 1 if you have the <sys/socket.h> header file. */
-#cmakedefine HAVE_SYS_SOCKET_H 1
-
 /* Define to 1 if you have the <sys/sockio.h> header file. */
 #cmakedefine HAVE_SYS_SOCKIO_H 1
 
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #cmakedefine HAVE_SYS_STAT_H 1
 
-/* 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
 
index c1051e0faefe11144d7cd015dc96906dc5d586c0..c5d56301c529363d30677820bc739aa289e0d542 100644 (file)
@@ -45,7 +45,7 @@
 #include <sys/stat.h>
 #endif
 
-#ifdef HAVE_SYS_TIME_H
+#if !defined(_WIN32) || defined(__MINGW32__)
 #include <sys/time.h>
 #endif
 
@@ -96,7 +96,7 @@
 #  endif
 #endif
 
-#ifdef HAVE_SYS_SOCKET_H
+#ifndef _WIN32
 #include <sys/socket.h>
 #endif
 
index 41ec909718f1b7faf742d57de2960fb69ea7fbb5..68f8c8d132d98a2265b029feffa74ae47a6c5317 100644 (file)
@@ -32,7 +32,7 @@ char *curlx_inet_ntop(int af, const void *addr, char *buf, size_t size);
 #ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif
-#ifdef HAVE_SYS_SOCKET_H
+#ifndef _WIN32
 #include <sys/socket.h>
 #endif
 #ifdef HAVE_ARPA_INET_H
index a9dc43085f4510ac81df6b2db554dd9cebc1a30b..610b329f51d64fac63511ee97e54bba0aa035269 100644 (file)
@@ -32,7 +32,7 @@ int curlx_inet_pton(int, const char *, void *);
 #ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif
-#ifdef HAVE_SYS_SOCKET_H
+#ifndef _WIN32
 #include <sys/socket.h>
 #endif
 #ifdef HAVE_ARPA_INET_H
index 35fe513a84206091654fe6eeedc4aa588cd3ae34..f95eacf62be8937aa276012d5af55429d983b9fe 100644 (file)
 /* ---------------------------------------------------------------- */
 #ifdef USE_WATT32
 #  include <tcp.h>
+#  include <sys/socket.h>
 #  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
index 79bb0ab746f69cb130aba22dbdefb83fe5408564..2818263b88f50e7585265ee7f4b7a752162bcc9b 100644 (file)
@@ -37,9 +37,6 @@ curl_includes_arpa_inet="\
 #ifdef HAVE_SYS_TYPES_H
 #  include <sys/types.h>
 #endif
-#ifdef HAVE_SYS_SOCKET_H
-#  include <sys/socket.h>
-#endif
 #ifdef HAVE_NETINET_IN_H
 #  include <netinet/in.h>
 #endif
@@ -49,10 +46,12 @@ curl_includes_arpa_inet="\
 #ifdef _WIN32
 #include <winsock2.h>
 #include <ws2tcpip.h>
+#else
+#include <sys/socket.h>
 #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 <sys/types.h>
 #endif
-#ifdef HAVE_SYS_SOCKET_H
+#ifndef _WIN32
 #  include <sys/socket.h>
 #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 <unistd.h>
 #endif
-#ifdef HAVE_SYS_SOCKET_H
+#ifndef _WIN32
 #  include <sys/socket.h>
 #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 <sys/types.h>
 #endif
-#ifdef HAVE_SYS_SOCKET_H
+#ifndef _WIN32
 #  include <sys/socket.h>
 #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 <sys/types.h>
 #endif
-#ifdef HAVE_SYS_TIME_H
+#if !defined(_WIN32) || defined(__MINGW32__)
 #  include <sys/time.h>
 #endif
 #include <time.h>
 /* includes end */"
   AC_CHECK_HEADERS(
-    sys/types.h sys/time.h,
+    sys/types.h,
     [], [], [$curl_includes_time])
 ])
 
index 7b6a72df259d208f91fd391787968acc245f813b..9aaf20e341bd10b1ef8086f8cfc43f39c88aba0c 100644 (file)
@@ -28,7 +28,7 @@
 #ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif
-#ifdef HAVE_SYS_SOCKET_H
+#ifndef _WIN32
 #include <sys/socket.h>
 #endif
 #ifdef HAVE_ARPA_INET_H