summaryrefslogtreecommitdiff
path: root/lib/curl_setup.h
diff options
context:
space:
mode:
authorPeng-Yu Chen <pengyu@libstarrify.so>2021-05-20 11:11:42 +0100
committerDaniel Stenberg <daniel@haxx.se>2021-05-21 08:39:39 +0200
commit07d20f5dfa45fe0c3e7ef56b89028887e3c4dc47 (patch)
treebe687c680a02f9cff416f5247c54289515624c0e /lib/curl_setup.h
parent84d2839740ca78041ac7419d9aaeac55c1e1c729 (diff)
downloadcurl-07d20f5dfa45fe0c3e7ef56b89028887e3c4dc47.tar.gz
cmake: detect CURL_SA_FAMILY_T
Fixes #7049 Closes #7065
Diffstat (limited to 'lib/curl_setup.h')
-rw-r--r--lib/curl_setup.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/curl_setup.h b/lib/curl_setup.h
index 5f4e4244a..b6ef53244 100644
--- a/lib/curl_setup.h
+++ b/lib/curl_setup.h
@@ -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.