cmake: detect CURL_SA_FAMILY_T

Fixes #7049
Closes #7065
This commit is contained in:
Peng-Yu Chen 2021-05-20 11:11:42 +01:00 committed by Daniel Stenberg
parent 84d2839740
commit 07d20f5dfa
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 25 additions and 2 deletions

View file

@ -313,6 +313,12 @@
/* Define to 1 if you have a IPv6 capable working inet_pton function. */
#cmakedefine HAVE_INET_PTON 1
/* 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 <inttypes.h> header file. */
#cmakedefine HAVE_INTTYPES_H 1

View file

@ -777,9 +777,16 @@ endings either CRLF or LF so 't' is appropriate.
# endif
#endif /* DONT_USE_RECV_BEFORE_SEND_WORKAROUND */
/* for systems that don't detect this in configure, use a sensible default */
/* for systems that don't detect this in configure */
#ifndef CURL_SA_FAMILY_T
#define CURL_SA_FAMILY_T unsigned short
# if defined(HAVE_SA_FAMILY_T)
# define CURL_SA_FAMILY_T sa_family_t
# elif defined(HAVE_ADDRESS_FAMILY)
# define CURL_SA_FAMILY_T ADDRESS_FAMILY
# else
/* use a sensible default */
# define CURL_SA_FAMILY_T unsigned short
# endif
#endif
/* Some convenience macros to get the larger/smaller value out of two given.