From f142056e01f2e3c58f89aaea80d131f129774d3e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 22 Apr 2025 08:55:21 +0200 Subject: [PATCH] hostip: fix build when no async resolvers are present Fixes #17124 Closes #17125 --- lib/asyn.h | 1 + lib/hostip.c | 2 ++ lib/hostip.h | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/lib/asyn.h b/lib/asyn.h index a8404bb6e1..b3516dc4eb 100644 --- a/lib/asyn.h +++ b/lib/asyn.h @@ -280,6 +280,7 @@ void Curl_async_shutdown(struct Curl_easy *data); void Curl_async_destroy(struct Curl_easy *data); #else /* !USE_CURL_ASYNC */ #define Curl_async_shutdown(x) Curl_nop_stmt +#define Curl_async_destroy(x) Curl_nop_stmt #endif /* USE_CURL_ASYNC */ diff --git a/lib/hostip.c b/lib/hostip.c index cb782f24fc..365151e8a6 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -1474,6 +1474,7 @@ fail: } #endif +#ifdef USE_CURL_ASYNC CURLcode Curl_resolv_check(struct Curl_easy *data, struct Curl_dns_entry **dns) { @@ -1508,6 +1509,7 @@ CURLcode Curl_resolv_check(struct Curl_easy *data, show_resolve_info(data, *dns); return result; } +#endif int Curl_resolv_getsock(struct Curl_easy *data, curl_socket_t *socks) diff --git a/lib/hostip.h b/lib/hostip.h index 99635bf6bc..43d80ba730 100644 --- a/lib/hostip.h +++ b/lib/hostip.h @@ -187,8 +187,13 @@ CURLcode Curl_dnscache_add(struct Curl_easy *data, * Populate the cache with specified entries from CURLOPT_RESOLVE. */ CURLcode Curl_loadhostpairs(struct Curl_easy *data); + +#ifdef USE_CURL_ASYNC CURLcode Curl_resolv_check(struct Curl_easy *data, struct Curl_dns_entry **dns); +#else +#define Curl_resolv_check(x,y) CURLE_NOT_BUILT_IN +#endif int Curl_resolv_getsock(struct Curl_easy *data, curl_socket_t *socks); -- 2.47.2