]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
singleuse: drop `Curl_memrchr()` for no-HTTP builds
authorViktor Szakats <commit@vsz.me>
Wed, 11 Sep 2024 19:48:55 +0000 (21:48 +0200)
committerViktor Szakats <commit@vsz.me>
Sun, 15 Sep 2024 14:33:24 +0000 (16:33 +0200)
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

lib/curl_memrchr.c
lib/curl_memrchr.h

index 3f3dc6de163106a023fbb6174d1e28b40b01220b..c6d55f10423bc4a146f2912bae1a216a5609d340 100644 (file)
@@ -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 */
index 45bb38c68e54f6aa0939429ab993afa01b80b6b7..67a21ef361751496c1fd1aff16aeff69724a226c 100644 (file)
 #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 */