From: Jay Satiro Date: Sat, 28 Oct 2023 04:23:40 +0000 (-0400) Subject: curl_setup: disallow Windows IPv6 builds missing getaddrinfo X-Git-Tag: curl-8_5_0~180 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=904ae1223829303f0e61d78585aa9b7a3a7ea0ca;p=thirdparty%2Fcurl.git curl_setup: disallow Windows IPv6 builds missing getaddrinfo - On Windows if IPv6 is enabled but getaddrinfo is missing then #error the build. curl can be built with IPv6 support (ENABLE_IPV6) but without the ability to resolve hosts to IPv6 addresses (HAVE_GETADDRINFO). On Windows this is highly unlikely and should be considered a bad build configuration. Such a bad configuration has already given us a bug that was hard to diagnose. See #12134 and #12136 for discussion. Ref: https://github.com/curl/curl/issues/12134 Ref: https://github.com/curl/curl/pull/12136 Closes https://github.com/curl/curl/pull/12221 --- diff --git a/lib/curl_setup.h b/lib/curl_setup.h index 4ee0aa0a3e..fc462280f5 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -586,6 +586,9 @@ #if defined(ENABLE_IPV6) && defined(HAVE_GETADDRINFO) # define CURLRES_IPV6 +#elif defined(ENABLE_IPV6) && (defined(WIN32) || defined(__CYGWIN__)) +/* assume on Windows that IPv6 without getaddrinfo is a broken build */ +# error "Unexpected build: IPv6 is enabled but getaddrinfo was not found." #else # define CURLRES_IPV4 #endif