src: simplify declaring curl_ca_embed

Also to avoid `-Wunused-macros` warnings.

Follow-up to 8a3740bc8e #14059
Cherry-picked from #20593

Closes #20601
This commit is contained in:
Viktor Szakats 2026-02-14 15:25:38 +01:00
parent 298f73f95b
commit a55f160b13
No known key found for this signature in database
4 changed files with 6 additions and 18 deletions

View file

@ -222,13 +222,6 @@ static CURLcode ssh_setopts(struct OperationConfig *config, CURL *curl)
return CURLE_OK; /* ignore if SHA256 did not work */
}
#ifdef CURL_CA_EMBED
#ifndef CURL_DECLARED_CURL_CA_EMBED
#define CURL_DECLARED_CURL_CA_EMBED
extern const unsigned char curl_ca_embed[];
#endif
#endif
static long tlsversion(unsigned char mintls,
unsigned char maxtls)
{

View file

@ -39,10 +39,8 @@ print <<HEAD
* NEVER EVER edit this manually, fix the mk-file-embed.pl script instead!
*/
/* !checksrc! disable COPYRIGHT all */
#ifndef CURL_DECLARED_${varname_upper}
#define CURL_DECLARED_${varname_upper}
extern const unsigned char ${varname}[];
#endif
#include "tool_setup.h"
const unsigned char ${varname}[] = {
HEAD
;

View file

@ -86,13 +86,6 @@
CURL_EXTERN CURLcode curl_easy_perform_ev(CURL *easy);
#endif
#ifdef CURL_CA_EMBED
#ifndef CURL_DECLARED_CURL_CA_EMBED
#define CURL_DECLARED_CURL_CA_EMBED
extern const unsigned char curl_ca_embed[];
#endif
#endif
#define CURL_CA_CERT_ERRORMSG \
"More details here: https://curl.se/docs/sslcerts.html\n\n" \
"curl failed to verify the legitimacy of the server and therefore " \

View file

@ -98,4 +98,8 @@ int tool_ftruncate64(int fd, curl_off_t where);
#endif /* !HAVE_FTRUNCATE */
#endif /* _WIN32 */
#ifdef CURL_CA_EMBED
extern const unsigned char curl_ca_embed[];
#endif
#endif /* HEADER_CURL_TOOL_SETUP_H */