mirror of
https://github.com/curl/curl.git
synced 2026-04-14 21:41:41 +03:00
windows: assume ADDRESS_FAMILY, drop feature checks
Early mingw-w64 releases missed it, but by requiring v3.0, this is no
longer an issue. Supported Visual Studio SDKs also offer it.
Follow-up to a28f5f68b9 #18010
Closes #18057
This commit is contained in:
parent
3bdef96aba
commit
c4ed28aebb
5 changed files with 11 additions and 36 deletions
|
|
@ -191,7 +191,6 @@ if(MINGW OR MSVC)
|
|||
curl_prefill_type_size("LONG_LONG" 8)
|
||||
curl_prefill_type_size("__INT64" 8)
|
||||
curl_prefill_type_size("CURL_OFF_T" 8)
|
||||
curl_prefill_type_size("ADDRESS_FAMILY" 2) # MSVC or mingw-w64 v2+
|
||||
# CURL_SOCKET_T, SIZE_T: 8 for _WIN64, 4 otherwise
|
||||
# TIME_T: 8 for _WIN64 or UCRT or MSVC and not Windows CE, 4 otherwise
|
||||
# Also 4 for non-UCRT 32-bit when _USE_32BIT_TIME_T is set.
|
||||
|
|
@ -224,7 +223,6 @@ if(WINCE)
|
|||
set(HAVE_STRTOK_R 0)
|
||||
set(HAVE__SETMODE 0)
|
||||
set(HAVE_FILE_OFFSET_BITS 0)
|
||||
set(HAVE_SIZEOF_ADDRESS_FAMILY 0)
|
||||
curl_prefill_type_size("SSIZE_T" 4)
|
||||
curl_prefill_type_size("OFF_T" 4)
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -1812,11 +1812,7 @@ if(HAVE_FSETXATTR)
|
|||
endif()
|
||||
|
||||
cmake_push_check_state()
|
||||
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})
|
||||
else()
|
||||
if(NOT WIN32)
|
||||
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})
|
||||
|
|
|
|||
30
configure.ac
30
configure.ac
|
|
@ -4045,30 +4045,14 @@ AC_CHECK_TYPE([bool],[
|
|||
#endif
|
||||
])
|
||||
|
||||
# check for sa_family_t
|
||||
AC_CHECK_TYPE(sa_family_t,
|
||||
AC_DEFINE(HAVE_SA_FAMILY_T, 1, [Define to 1 if symbol `sa_family_t' exists]),
|
||||
if test "$curl_cv_native_windows" != 'yes'; then
|
||||
# check for sa_family_t
|
||||
AC_CHECK_TYPE(sa_family_t,
|
||||
AC_DEFINE(HAVE_SA_FAMILY_T, 1, [Define to 1 if symbol `sa_family_t' exists]),,
|
||||
[
|
||||
# The Windows name?
|
||||
AC_CHECK_TYPE(ADDRESS_FAMILY,
|
||||
AC_DEFINE(HAVE_ADDRESS_FAMILY, 1, [Define to 1 if symbol `ADDRESS_FAMILY' exists]),
|
||||
[],
|
||||
[
|
||||
#ifdef _WIN32
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
])
|
||||
],
|
||||
[
|
||||
#ifndef _WIN32
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
])
|
||||
#include <sys/socket.h>
|
||||
])
|
||||
fi
|
||||
|
||||
# check for suseconds_t
|
||||
AC_CHECK_TYPE([suseconds_t],[
|
||||
|
|
|
|||
|
|
@ -336,9 +336,6 @@
|
|||
/* Define to 1 if symbol `sa_family_t' exists */
|
||||
#cmakedefine HAVE_SA_FAMILY_T 1
|
||||
|
||||
/* Define to 1 if symbol `ADDRESS_FAMILY' exists */
|
||||
#cmakedefine HAVE_ADDRESS_FAMILY 1
|
||||
|
||||
/* Define to 1 if you have the ioctlsocket function. */
|
||||
#cmakedefine HAVE_IOCTLSOCKET 1
|
||||
|
||||
|
|
|
|||
|
|
@ -937,10 +937,10 @@ endings either CRLF or LF so 't' is appropriate.
|
|||
|
||||
/* for systems that do not detect this in configure */
|
||||
#ifndef CURL_SA_FAMILY_T
|
||||
# ifdef HAVE_SA_FAMILY_T
|
||||
# define CURL_SA_FAMILY_T sa_family_t
|
||||
# elif defined(HAVE_ADDRESS_FAMILY)
|
||||
# if defined(_WIN32) && !defined(UNDER_CE)
|
||||
# define CURL_SA_FAMILY_T ADDRESS_FAMILY
|
||||
# elif defined(HAVE_SA_FAMILY_T)
|
||||
# define CURL_SA_FAMILY_T sa_family_t
|
||||
# elif defined(__AMIGA__)
|
||||
# define CURL_SA_FAMILY_T unsigned char
|
||||
# else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue