lib: skip compiling code with features disabled

In non-SSL, non-SSH, non-H3, non-AppleSecTrust builds.

Also:
- drop unused internal macro `SSL_SYSTEM_VERIFIER`.

Closes #20587
This commit is contained in:
Viktor Szakats 2026-02-13 10:32:28 +01:00
parent 0649eb0825
commit d445f2d930
No known key found for this signature in database
10 changed files with 31 additions and 28 deletions

View file

@ -24,6 +24,7 @@
*
***************************************************************************/
#include "../curl_setup.h"
#include "../urldata.h"
extern const struct Curl_protocol Curl_protocol_sftp;
extern const struct Curl_protocol Curl_protocol_scp;
@ -31,6 +32,8 @@ extern const struct Curl_protocol Curl_protocol_scp;
extern const struct Curl_scheme Curl_scheme_sftp;
extern const struct Curl_scheme Curl_scheme_scp;
#ifdef USE_SSH
#ifdef USE_LIBSSH2
#include <libssh2.h>
#include <libssh2_sftp.h>
@ -236,8 +239,6 @@ struct ssh_conn {
#endif /* USE_LIBSSH2 */
#ifdef USE_SSH
#ifdef CURLVERBOSE
const char *Curl_ssh_statename(sshstate state);
#else
@ -255,11 +256,10 @@ void Curl_ssh_cleanup(void);
void Curl_ssh_version(char *buffer, size_t buflen);
void Curl_ssh_attach(struct Curl_easy *data,
struct connectdata *conn);
#else
/* for non-SSH builds */
#else /* !USE_SSH */
#define Curl_ssh_cleanup()
#define Curl_ssh_attach(x, y)
#define Curl_ssh_init() 0
#endif
#endif /* USE_SSH */
#endif /* HEADER_CURL_SSH_H */

View file

@ -22,10 +22,11 @@
*
***************************************************************************/
#include "../curl_setup.h"
#include "ssh.h"
#ifdef USE_SSH
#include "vssh.h"
#include "ssh.h"
#ifdef USE_SSH
#include "../curlx/strparse.h"
#include "../curl_trc.h"
#include "../escape.h"

View file

@ -25,6 +25,8 @@
***************************************************************************/
#include "../curl_setup.h"
#ifdef USE_SSH
#include "../urldata.h"
CURLcode Curl_getworkingpath(struct Curl_easy *data,
@ -36,5 +38,5 @@ CURLcode Curl_get_pathname(const char **cpp, char **path, const char *homedir);
CURLcode Curl_ssh_range(struct Curl_easy *data,
const char *range, curl_off_t filesize,
curl_off_t *startp, curl_off_t *sizep);
#endif /* USE_SSH */
#endif /* HEADER_CURL_VSSH_VSSH_H */