From: Viktor Szakats Date: Wed, 11 Sep 2024 19:48:55 +0000 (+0200) Subject: singleuse: drop `Curl_memrchr()` for no-HTTP builds X-Git-Tag: curl-8_10_1~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0ba70dd13c865da48871bbfd9a540969939b309c;p=thirdparty%2Fcurl.git singleuse: drop `Curl_memrchr()` for no-HTTP builds Make single-use function check CI test pass by dropping the global `Curl_memrchr()` function from the build when it has no caller. Fixes: ``` Curl_memrchr in curl_memrchr ``` https://github.com/curl/curl/actions/runs/10816280747/job/30007145114 Seen while migrating affected job from Azure to GHA. Ref: #14859 Closes #14919 --- diff --git a/lib/curl_memrchr.c b/lib/curl_memrchr.c index 3f3dc6de16..c6d55f1042 100644 --- a/lib/curl_memrchr.c +++ b/lib/curl_memrchr.c @@ -33,6 +33,9 @@ #include "memdebug.h" #ifndef HAVE_MEMRCHR +#if (!defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)) || \ + defined(USE_OPENSSL) || \ + defined(USE_SCHANNEL) /* * Curl_memrchr() @@ -61,4 +64,5 @@ Curl_memrchr(const void *s, int c, size_t n) return NULL; } +#endif #endif /* HAVE_MEMRCHR */ diff --git a/lib/curl_memrchr.h b/lib/curl_memrchr.h index 45bb38c68e..67a21ef361 100644 --- a/lib/curl_memrchr.h +++ b/lib/curl_memrchr.h @@ -34,11 +34,15 @@ #endif #else /* HAVE_MEMRCHR */ +#if (!defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)) || \ + defined(USE_OPENSSL) || \ + defined(USE_SCHANNEL) void *Curl_memrchr(const void *s, int c, size_t n); #define memrchr(x,y,z) Curl_memrchr((x),(y),(z)) +#endif #endif /* HAVE_MEMRCHR */ #endif /* HEADER_CURL_MEMRCHR_H */