tidy-up: prefer ifdef/ifndef for single checks

Closes #18018
This commit is contained in:
Viktor Szakats 2025-07-25 14:31:16 +02:00
parent b2bccdc257
commit 89771d19d5
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
109 changed files with 319 additions and 324 deletions

View file

@ -203,7 +203,7 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data,
status == SEC_I_COMPLETE_AND_CONTINUE)
Curl_pSecFn->CompleteAuthToken(&credentials, &resp_desc);
else if(status != SEC_E_OK && status != SEC_I_CONTINUE_NEEDED) {
#if !defined(CURL_DISABLE_VERBOSE_STRINGS)
#ifndef CURL_DISABLE_VERBOSE_STRINGS
char buffer[STRERROR_LEN];
#endif
@ -215,7 +215,7 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data,
if(status == SEC_E_INSUFFICIENT_MEMORY)
return CURLE_OUT_OF_MEMORY;
#if !defined(CURL_DISABLE_VERBOSE_STRINGS)
#ifndef CURL_DISABLE_VERBOSE_STRINGS
infof(data, "schannel: InitializeSecurityContext failed: %s",
Curl_sspi_strerror(status, buffer, sizeof(buffer)));
#endif
@ -602,7 +602,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data,
status == SEC_I_COMPLETE_AND_CONTINUE)
Curl_pSecFn->CompleteAuthToken(&credentials, &resp_desc);
else if(status != SEC_E_OK && status != SEC_I_CONTINUE_NEEDED) {
#if !defined(CURL_DISABLE_VERBOSE_STRINGS)
#ifndef CURL_DISABLE_VERBOSE_STRINGS
char buffer[STRERROR_LEN];
#endif
@ -616,7 +616,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data,
if(status == SEC_E_INSUFFICIENT_MEMORY)
return CURLE_OUT_OF_MEMORY;
#if !defined(CURL_DISABLE_VERBOSE_STRINGS)
#ifndef CURL_DISABLE_VERBOSE_STRINGS
infof(data, "schannel: InitializeSecurityContext failed: %s",
Curl_sspi_strerror(status, buffer, sizeof(buffer)));
#endif

View file

@ -270,7 +270,7 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data,
SecPkgContext_Sizes sizes;
SECURITY_STATUS status;
#if defined(CURL_DISABLE_VERBOSE_STRINGS)
#ifdef CURL_DISABLE_VERBOSE_STRINGS
(void)data;
#endif

View file

@ -268,7 +268,7 @@ static CURLcode ntlm_decode_type2_target(struct Curl_easy *data,
const unsigned char *type2 = Curl_bufref_ptr(type2ref);
size_t type2len = Curl_bufref_len(type2ref);
#if defined(CURL_DISABLE_VERBOSE_STRINGS)
#ifdef CURL_DISABLE_VERBOSE_STRINGS
(void)data;
#endif
@ -368,7 +368,7 @@ CURLcode Curl_auth_decode_ntlm_type2_message(struct Curl_easy *data,
const unsigned char *type2 = Curl_bufref_ptr(type2ref);
size_t type2len = Curl_bufref_len(type2ref);
#if defined(CURL_DISABLE_VERBOSE_STRINGS)
#ifdef CURL_DISABLE_VERBOSE_STRINGS
(void)data;
#endif

View file

@ -205,7 +205,7 @@ CURLcode Curl_auth_decode_ntlm_type2_message(struct Curl_easy *data,
const struct bufref *type2,
struct ntlmdata *ntlm)
{
#if defined(CURL_DISABLE_VERBOSE_STRINGS)
#ifdef CURL_DISABLE_VERBOSE_STRINGS
(void)data;
#endif
@ -257,7 +257,7 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data,
unsigned long attrs;
TimeStamp expiry; /* For Windows 9x compatibility of SSPI calls */
#if defined(CURL_DISABLE_VERBOSE_STRINGS)
#ifdef CURL_DISABLE_VERBOSE_STRINGS
(void)data;
#endif
(void)passwdp;

View file

@ -107,7 +107,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data,
unsigned long attrs;
TimeStamp expiry; /* For Windows 9x compatibility of SSPI calls */
#if defined(CURL_DISABLE_VERBOSE_STRINGS)
#ifdef CURL_DISABLE_VERBOSE_STRINGS
(void)data;
#endif

View file

@ -54,7 +54,7 @@
*
* Returns a pointer to the newly allocated SPN.
*/
#if !defined(USE_WINDOWS_SSPI)
#ifndef USE_WINDOWS_SSPI
char *Curl_auth_build_spn(const char *service, const char *host,
const char *realm)
{

View file

@ -32,11 +32,11 @@
struct Curl_easy;
struct connectdata;
#if !defined(CURL_DISABLE_DIGEST_AUTH)
#ifndef CURL_DISABLE_DIGEST_AUTH
struct digestdata;
#endif
#if defined(USE_NTLM)
#ifdef USE_NTLM
struct ntlmdata;
#endif
@ -44,7 +44,7 @@ struct ntlmdata;
struct negotiatedata;
#endif
#if defined(USE_GSASL)
#ifdef USE_GSASL
struct gsasldata;
#endif
@ -60,7 +60,7 @@ struct gsasldata;
bool Curl_auth_allowed_to_host(struct Curl_easy *data);
/* This is used to build an SPN string */
#if !defined(USE_WINDOWS_SSPI)
#ifndef USE_WINDOWS_SSPI
char *Curl_auth_build_spn(const char *service, const char *host,
const char *realm);
#else
@ -153,7 +153,7 @@ CURLcode Curl_auth_gsasl_token(struct Curl_easy *data,
void Curl_auth_gsasl_cleanup(struct gsasldata *digest);
#endif
#if defined(USE_NTLM)
#ifdef USE_NTLM
/* meta key for storing NTML meta at connection */
#define CURL_META_NTLM_CONN "meta:auth:ntml:conn"
@ -231,7 +231,7 @@ CURLcode Curl_auth_create_xoauth_bearer_message(const char *user,
const char *bearer,
struct bufref *out);
#if defined(USE_KERBEROS5)
#ifdef USE_KERBEROS5
#ifdef HAVE_GSSAPI
# ifdef HAVE_GSSGNU
@ -250,7 +250,7 @@ CURLcode Curl_auth_create_xoauth_bearer_message(const char *user,
#define CURL_META_KRB5_CONN "meta:auth:krb5:conn"
struct kerberos5data {
#if defined(USE_WINDOWS_SSPI)
#ifdef USE_WINDOWS_SSPI
CredHandle *credentials;
CtxtHandle *context;
TCHAR *spn;