#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
#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
#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)
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)
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;
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)
{
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)
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)
{
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)
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()
HAVE_STDBOOL_H
HAVE_STROPTS_H
HAVE_SYS_IOCTL_H
- HAVE_SYS_SOCKET_H
HAVE_SYS_TYPES_H
HAVE_UNISTD_H
)
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})
#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
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([
#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);
]])
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([
#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);
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([[
#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;
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([[
#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;
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])
#
#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>
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([
#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>
#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>
#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>
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([
#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
#elif defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
- #ifdef HAVE_SYS_SOCKET_H
- #include <sys/socket.h>
- #endif
$curl_includes_bsdsocket
#endif
]],[[
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(
#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
#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
#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
])
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
-#ifdef HAVE_SYS_TIME_H
+#ifndef _WIN32
#include <sys/time.h>
#endif
])
#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
#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
/* 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
#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
/* 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
/* 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
/* 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
#include <sys/stat.h>
#endif
-#ifdef HAVE_SYS_TIME_H
+#if !defined(_WIN32) || defined(__MINGW32__)
#include <sys/time.h>
#endif
# endif
#endif
-#ifdef HAVE_SYS_SOCKET_H
+#ifndef _WIN32
#include <sys/socket.h>
#endif
#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
#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
/* ---------------------------------------------------------------- */
#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
#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
#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])
])
#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
#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])
])
#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
#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])
])
#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])
])
#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])
])
#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