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

@ -71,12 +71,12 @@ size_t tool_read_cb(char *buffer, size_t sz, size_t nmemb, void *userdata)
timeout.tv_usec = (int)((wait%1000)*1000);
FD_ZERO(&bits);
#if defined(__DJGPP__)
#ifdef __DJGPP__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warith-conversion"
#endif
FD_SET(per->infd, &bits);
#if defined(__DJGPP__)
#ifdef __DJGPP__
#pragma GCC diagnostic pop
#endif
if(!select(per->infd + 1, &bits, NULL, NULL, &timeout))
@ -161,12 +161,12 @@ int tool_readbusy_cb(void *clientp,
timeout.tv_usec = 1000;
FD_ZERO(&bits);
#if defined(__DJGPP__)
#ifdef __DJGPP__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warith-conversion"
#endif
FD_SET(per->infd, &bits);
#if defined(__DJGPP__)
#ifdef __DJGPP__
#pragma GCC diagnostic pop
#endif
select(per->infd + 1, &bits, NULL, NULL, &timeout);

View file

@ -151,4 +151,4 @@ void setfiletime(curl_off_t filetime, const char *filename,
#endif
}
}
#endif /* defined(HAVE_UTIME) || defined(HAVE_UTIMES) || defined(_WIN32) */
#endif /* HAVE_UTIME || HAVE_UTIMES || _WIN32 */

View file

@ -30,13 +30,12 @@ struct GlobalConfig;
int getfiletime(const char *filename, struct GlobalConfig *global,
curl_off_t *stamp);
#if defined(HAVE_UTIME) || defined(HAVE_UTIMES) || \
#if defined(HAVE_UTIME) || defined(HAVE_UTIMES) || \
(defined(_WIN32) && (SIZEOF_CURL_OFF_T >= 8))
void setfiletime(curl_off_t filetime, const char *filename,
struct GlobalConfig *global);
#else
#define setfiletime(a,b,c) tool_nop_stmt
#endif /* defined(HAVE_UTIME) || defined(HAVE_UTIMES) || \
(defined(_WIN32) && (SIZEOF_CURL_OFF_T >= 8)) */
#endif
#endif /* HEADER_CURL_TOOL_FILETIME_H */

View file

@ -61,8 +61,8 @@
int vms_show = 0;
#endif
#if defined(__AMIGA__)
#if defined(__GNUC__)
#ifdef __AMIGA__
#ifdef __GNUC__
#define CURL_USED __attribute__((used))
#else
#define CURL_USED

View file

@ -2104,7 +2104,7 @@ static CURLcode cacertpaths(struct OperationConfig *config)
#ifdef _WIN32
if(!env) {
#if defined(CURL_CA_SEARCH_SAFE)
#ifdef CURL_CA_SEARCH_SAFE
char *cacert = NULL;
FILE *cafile = tool_execpath("curl-ca-bundle.crt", &cacert);
if(cafile) {