build: prefer USE_IPV6 macro internally (was: ENABLE_IPV6)

Before this patch, two macros were used to guard IPv6 features in curl
sources: `ENABLE_IPV6` and `USE_IPV6`. This patch makes the source use
the latter for consistency with other similar switches.

`-DENABLE_IPV6` remains accepted for compatibility as a synonym for
`-DUSE_IPV6`, when passed to the compiler.

`ENABLE_IPV6` also remains the name of the CMake and `Makefile.vc`
options to control this feature.

Closes #13349
This commit is contained in:
Viktor Szakats 2024-04-11 12:01:58 +00:00
parent de66e8ad38
commit e411c98f70
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
47 changed files with 197 additions and 196 deletions

View file

@ -62,7 +62,7 @@ struct testcase {
/* In builds without IPv6 support CURLOPT_RESOLVE should skip over those
addresses, so we have to do that as well. */
static const char skip = 0;
#ifdef ENABLE_IPV6
#ifdef USE_IPV6
#define IPV6ONLY(x) x
#else
#define IPV6ONLY(x) &skip

View file

@ -193,7 +193,7 @@ static CURLcode cf_test_create(struct Curl_cfilter **pcf,
ctx->ai_family = ai->ai_family;
ctx->transport = transport;
ctx->started = Curl_now();
#ifdef ENABLE_IPV6
#ifdef USE_IPV6
if(ctx->ai_family == AF_INET6) {
ctx->stats = &current_tr->cf6;
ctx->fail_delay_ms = current_tc->cf6_fail_delay_ms;
@ -358,7 +358,7 @@ static struct test_case TEST_CASES[] = {
{ 2, TURL, "test.com:123:192.0.2.1,192.0.2.2", CURL_IPRESOLVE_WHATEVER,
CNCT_TMOT, 150, 200, 200, 2, 0, 400, TC_TMOT, R_FAIL, NULL },
/* 2 ipv4, fails after ~400ms, reports COULDNT_CONNECT */
#ifdef ENABLE_IPV6
#ifdef USE_IPV6
{ 3, TURL, "test.com:123:::1", CURL_IPRESOLVE_WHATEVER,
CNCT_TMOT, 150, 200, 200, 0, 1, 200, TC_TMOT, R_FAIL, NULL },
/* 1 ipv6, fails after ~200ms, reports COULDNT_CONNECT */