diff --git a/lib/connect.c b/lib/connect.c index 89912157e0..c4b9564a88 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -1309,7 +1309,7 @@ connect_sub_chain: } #endif /* USE_SSL */ -#if !defined(CURL_DISABLE_HTTP) +#ifndef CURL_DISABLE_HTTP if(cf->conn->bits.tunnel_proxy) { result = Curl_cf_http_proxy_insert_after(cf, data); if(result) @@ -1323,7 +1323,7 @@ connect_sub_chain: #endif /* !CURL_DISABLE_PROXY */ if(ctx->state < CF_SETUP_CNNCT_HAPROXY) { -#if !defined(CURL_DISABLE_PROXY) +#ifndef CURL_DISABLE_PROXY if(data->set.haproxyprotocol) { if(Curl_conn_is_ssl(cf->conn, cf->sockindex)) { failf(data, "haproxy protocol not support with SSL " @@ -1502,7 +1502,7 @@ CURLcode Curl_conn_setup(struct Curl_easy *data, Curl_resolv_unlink(data, &data->state.dns[sockindex]); data->state.dns[sockindex] = dns; -#if !defined(CURL_DISABLE_HTTP) +#ifndef CURL_DISABLE_HTTP if(!conn->cfilter[sockindex] && conn->handler->protocol == CURLPROTO_HTTPS) { DEBUGASSERT(ssl_mode != CURL_CF_SSL_DISABLE); diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c index fa3c809b97..d1ab3cb561 100644 --- a/lib/curl_ntlm_core.c +++ b/lib/curl_ntlm_core.c @@ -58,7 +58,7 @@ #endif #elif defined(USE_WOLFSSL) #include - #if !defined(NO_DES3) + #ifndef NO_DES3 #define USE_OPENSSL_DES #endif #endif @@ -129,7 +129,7 @@ #include "curl_memory.h" #include "memdebug.h" -#if !defined(CURL_NTLM_NOT_SUPPORTED) +#ifndef CURL_NTLM_NOT_SUPPORTED /* * Turns a 56-bit key into being 64-bit wide. */ @@ -329,7 +329,7 @@ CURLcode Curl_ntlm_core_mk_lm_hash(const char *password, unsigned char *lmbuffer /* 21 bytes */) { unsigned char pw[14]; -#if !defined(CURL_NTLM_NOT_SUPPORTED) +#ifndef CURL_NTLM_NOT_SUPPORTED static const unsigned char magic[] = { 0x4B, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25 /* i.e. KGS!@#$% */ }; @@ -380,7 +380,7 @@ static void ascii_to_unicode_le(unsigned char *dest, const char *src, } } -#if !defined(USE_WINDOWS_SSPI) +#ifndef USE_WINDOWS_SSPI static void ascii_uppercase_to_unicode_le(unsigned char *dest, const char *src, size_t srclen) @@ -422,7 +422,7 @@ CURLcode Curl_ntlm_core_mk_nt_hash(const char *password, return result; } -#if !defined(USE_WINDOWS_SSPI) +#ifndef USE_WINDOWS_SSPI #define NTLMv2_BLOB_SIGNATURE "\x01\x01\x00\x00" #define NTLMv2_BLOB_LEN (44 -16 + ntlm->target_info_len + 4) diff --git a/lib/curl_ntlm_core.h b/lib/curl_ntlm_core.h index 31cf95ccef..584f4a17d5 100644 --- a/lib/curl_ntlm_core.h +++ b/lib/curl_ntlm_core.h @@ -47,7 +47,7 @@ CURLcode Curl_ntlm_core_mk_lm_hash(const char *password, CURLcode Curl_ntlm_core_mk_nt_hash(const char *password, unsigned char *ntbuffer /* 21 bytes */); -#if !defined(USE_WINDOWS_SSPI) +#ifndef USE_WINDOWS_SSPI CURLcode Curl_hmac_md5(const unsigned char *key, unsigned int keylen, const unsigned char *data, unsigned int datalen, diff --git a/lib/curl_setup.h b/lib/curl_setup.h index bdb87f4d49..f5e16d7633 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -1003,7 +1003,7 @@ int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf, #endif #if defined(USE_UNIX_SOCKETS) && defined(_WIN32) -# if !defined(UNIX_PATH_MAX) +# ifndef UNIX_PATH_MAX /* Replicating logic present in afunix.h (distributed with newer Windows 10 SDK versions only) */ # define UNIX_PATH_MAX 108 diff --git a/lib/ldap.c b/lib/ldap.c index 6c5fb433b0..7fc0da0b2d 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -248,7 +248,7 @@ static int ldap_win_bind_auth(LDAP *server, const char *user, } else #endif -#if !defined(CURL_DISABLE_DIGEST_AUTH) +#ifndef CURL_DISABLE_DIGEST_AUTH if(authflags & CURLAUTH_DIGEST) { method = LDAP_AUTH_DIGEST; } diff --git a/lib/md5.c b/lib/md5.c index 591ce32ed0..fea20377fe 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -177,7 +177,7 @@ static void my_md5_update(void *ctx, const unsigned char *data, unsigned int length) { -#if !defined(HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS) +#ifndef HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS (void)mbedtls_md5_update(ctx, data, length); #else (void)mbedtls_md5_update_ret(ctx, data, length); @@ -186,7 +186,7 @@ static void my_md5_update(void *ctx, static void my_md5_final(unsigned char *digest, void *ctx) { -#if !defined(HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS) +#ifndef HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS (void)mbedtls_md5_finish(ctx, digest); #else (void)mbedtls_md5_finish_ret(ctx, digest); diff --git a/lib/multihandle.h b/lib/multihandle.h index 4bf2dd811c..dbad164bc5 100644 --- a/lib/multihandle.h +++ b/lib/multihandle.h @@ -80,7 +80,7 @@ typedef enum { #define CURLPIPE_ANY (CURLPIPE_MULTIPLEX) -#if !defined(CURL_DISABLE_SOCKETPAIR) +#ifndef CURL_DISABLE_SOCKETPAIR #define ENABLE_WAKEUP #endif diff --git a/lib/rand.c b/lib/rand.c index 8529f9ede1..d6f4a2dffc 100644 --- a/lib/rand.c +++ b/lib/rand.c @@ -100,7 +100,7 @@ CURLcode Curl_win32_random(unsigned char *entropy, size_t length) } #endif -#if !defined(USE_SSL) +#ifndef USE_SSL /* ---- possibly non-cryptographic version following ---- */ static CURLcode weak_random(struct Curl_easy *data, unsigned char *entropy, diff --git a/lib/setopt.c b/lib/setopt.c index 1be45dc05b..3d1ce791e8 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -646,7 +646,7 @@ static CURLcode setopt_long(struct Curl_easy *data, CURLoption option, data->set.postfieldsize = arg; break; #ifndef CURL_DISABLE_HTTP -#if !defined(CURL_DISABLE_COOKIES) +#ifndef CURL_DISABLE_COOKIES case CURLOPT_COOKIESESSION: /* * Set this option to TRUE to start a new "cookie session". It will @@ -1778,7 +1778,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, } return Curl_setstropt(&data->set.str[STRING_ENCODING], ptr); -#if !defined(CURL_DISABLE_AWS) +#ifndef CURL_DISABLE_AWS case CURLOPT_AWS_SIGV4: /* * String that is merged to some authentication @@ -1810,7 +1810,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, */ return Curl_setstropt(&data->set.str[STRING_USERAGENT], ptr); -#if !defined(CURL_DISABLE_COOKIES) +#ifndef CURL_DISABLE_COOKIES case CURLOPT_COOKIE: /* * Cookie string to send to the remote server in the request. diff --git a/lib/sha256.c b/lib/sha256.c index e78ad1f5d3..4d71c9b4ad 100644 --- a/lib/sha256.c +++ b/lib/sha256.c @@ -134,7 +134,7 @@ typedef mbedtls_sha256_context my_sha256_ctx; static CURLcode my_sha256_init(void *ctx) { -#if !defined(HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS) +#ifndef HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS (void)mbedtls_sha256_starts(ctx, 0); #else (void)mbedtls_sha256_starts_ret(ctx, 0); @@ -146,7 +146,7 @@ static void my_sha256_update(void *ctx, const unsigned char *data, unsigned int length) { -#if !defined(HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS) +#ifndef HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS (void)mbedtls_sha256_update(ctx, data, length); #else (void)mbedtls_sha256_update_ret(ctx, data, length); @@ -155,7 +155,7 @@ static void my_sha256_update(void *ctx, static void my_sha256_final(unsigned char *digest, void *ctx) { -#if !defined(HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS) +#ifndef HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS (void)mbedtls_sha256_finish(ctx, digest); #else (void)mbedtls_sha256_finish_ret(ctx, digest); @@ -191,7 +191,7 @@ struct sha256_ctx { }; typedef struct sha256_ctx my_sha256_ctx; -#if !defined(CALG_SHA_256) +#ifndef CALG_SHA_256 #define CALG_SHA_256 0x0000800c #endif