From e150150d9f1e0578c85af05de15ab6336066cec1 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Wed, 11 Oct 2006 16:01:16 +0000 Subject: [PATCH] Remove redundant __CYGWIN__ symbol check --- ares/ares.h | 2 +- lib/dict.c | 2 +- lib/easy.c | 2 +- lib/file.c | 2 +- lib/ftp.c | 2 +- lib/http.c | 2 +- lib/strerror.c | 6 +++--- lib/timeval.h | 2 +- lib/transfer.c | 2 +- lib/url.c | 11 ++++++----- src/main.c | 6 +++--- tests/libtest/first.c | 2 +- tests/libtest/lib518.c | 2 +- tests/server/resolve.c | 2 +- tests/server/sockfilt.c | 2 +- tests/server/sws.c | 2 +- tests/server/tftpd.c | 2 +- tests/server/util.c | 6 +++--- tests/server/util.h | 5 ++--- 19 files changed, 31 insertions(+), 31 deletions(-) diff --git a/ares/ares.h b/ares/ares.h index f4d98c87d..9414f9b78 100644 --- a/ares/ares.h +++ b/ares/ares.h @@ -31,7 +31,7 @@ #include #include #include -#elif defined(WIN32) && !defined(__CYGWIN__) +#elif defined(WIN32) #include #include #else diff --git a/lib/dict.c b/lib/dict.c index b14426a28..d6443f4b9 100644 --- a/lib/dict.c +++ b/lib/dict.c @@ -38,7 +38,7 @@ #include #endif -#if defined(WIN32) && !defined(__CYGWIN__) +#ifdef WIN32 #include #include #else diff --git a/lib/easy.c b/lib/easy.c index cd931b82c..a400f84f1 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -40,7 +40,7 @@ #include "strequal.h" -#if defined(WIN32) && !defined(__CYGWIN__) +#ifdef WIN32 #include #include #else diff --git a/lib/file.c b/lib/file.c index 1d4356b8f..e9ed5b7f0 100644 --- a/lib/file.c +++ b/lib/file.c @@ -37,7 +37,7 @@ #include #endif -#if defined(WIN32) && !defined(__CYGWIN__) +#ifdef WIN32 #include #include #include diff --git a/lib/ftp.c b/lib/ftp.c index b71167aa4..2dcbb8809 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -34,7 +34,7 @@ #include #endif -#if defined(WIN32) && !defined(__CYGWIN__) +#ifdef WIN32 #else /* probably some kind of unix */ #ifdef HAVE_SYS_SOCKET_H diff --git a/lib/http.c b/lib/http.c index 809f20ca9..596a380d7 100644 --- a/lib/http.c +++ b/lib/http.c @@ -37,7 +37,7 @@ #include #endif -#if defined(WIN32) && !defined(__CYGWIN__) +#ifdef WIN32 #include #include #else diff --git a/lib/strerror.c b/lib/strerror.c index 0309e4ff7..5b01a2297 100644 --- a/lib/strerror.c +++ b/lib/strerror.c @@ -382,7 +382,7 @@ curl_share_strerror(CURLSHcode error) #endif } -#if defined(WIN32) && !defined(__CYGWIN__) +#ifdef WIN32 /* This function handles most / all (?) Winsock errors cURL is able to produce. */ @@ -570,7 +570,7 @@ get_winsock_error (int err, char *buf, size_t len) buf [len-1] = '\0'; return buf; } -#endif /* WIN32 && !__CYGWIN__ */ +#endif /* WIN32 */ /* * Our thread-safe and smart strerror() replacement. @@ -595,7 +595,7 @@ const char *Curl_strerror(struct connectdata *conn, int err) max = sizeof(conn->syserr_buf)-1; *buf = '\0'; -#if defined(WIN32) && !defined(__CYGWIN__) +#ifdef WIN32 #ifdef _WIN32_WCE buf[0]=0; diff --git a/lib/timeval.h b/lib/timeval.h index f79f41c73..8ab7a4401 100644 --- a/lib/timeval.h +++ b/lib/timeval.h @@ -30,7 +30,7 @@ #include "setup.h" -#if defined(WIN32) && !defined(__CYGWIN__) +#ifdef WIN32 #include #else #ifdef HAVE_SYS_TIME_H diff --git a/lib/transfer.c b/lib/transfer.c index ded1d5573..6cd071dc1 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -41,7 +41,7 @@ #include "strtoofft.h" #include "strequal.h" -#if defined(WIN32) && !defined(__CYGWIN__) +#ifdef WIN32 #include #include #else diff --git a/lib/url.c b/lib/url.c index fefab252f..dee4b40b9 100644 --- a/lib/url.c +++ b/lib/url.c @@ -38,7 +38,7 @@ #endif #include -#if defined(WIN32) && !defined(__CYGWIN__) +#ifdef WIN32 #include #include #else @@ -165,9 +165,10 @@ static void signalPipeClose(struct curl_llist *pipe); #define MAX_PIPELINE_LENGTH 5 #ifndef USE_ARES -/* not for Win32, unless it is cygwin - not for ares builds */ -#if !defined(WIN32) || defined(__CYGWIN__) +/* not for ares builds */ + +#ifndef WIN32 +/* not for WIN32 builds */ #ifndef RETSIGTYPE #define RETSIGTYPE void @@ -187,8 +188,8 @@ RETSIGTYPE alarmfunc(int sig) #endif return; } -#endif #endif /* SIGALRM */ +#endif /* WIN32 */ #endif /* USE_ARES */ void Curl_safefree(void *ptr) diff --git a/src/main.c b/src/main.c index bb3839253..171097af7 100644 --- a/src/main.c +++ b/src/main.c @@ -3107,7 +3107,7 @@ static void free_config_fields(struct Configurable *config) curl_slist_free_all(config->headers); } -#if defined(WIN32) && !defined(__CYGWIN__) +#ifdef WIN32 /* Function to find CACert bundle on a Win32 platform using SearchPath. * (SearchPath is already declared via inclusions done in setup header file) @@ -3322,7 +3322,7 @@ operate(struct Configurable *config, int argc, char *argv[]) else allocuseragent = TRUE; - /* On WIN32 (non-cygwin), we can't set the path to curl-ca-bundle.crt + /* On WIN32 we can't set the path to curl-ca-bundle.crt * at compile time. So we look here for the file in two ways: * 1: look at the environment variable CURL_CA_BUNDLE for a path * 2: if #1 isn't found, use the windows API function SearchPath() @@ -3350,7 +3350,7 @@ operate(struct Configurable *config, int argc, char *argv[]) if(env) curl_free(env); -#if defined(WIN32) && !defined(__CYGWIN__) +#ifdef WIN32 else FindWin32CACert(config, "curl-ca-bundle.crt"); #endif diff --git a/tests/libtest/first.c b/tests/libtest/first.c index 8050537db..fda1a7fb5 100644 --- a/tests/libtest/first.c +++ b/tests/libtest/first.c @@ -12,7 +12,7 @@ int test(char *url); int select_test (int num_fds, fd_set *rd, fd_set *wr, fd_set *exc, struct timeval *tv) { -#if defined(WIN32) && !defined(__CYGWIN__) +#ifdef WIN32 /* Winsock doesn't like no socket set in 'rd', 'wr' or 'exc'. This is * case when 'num_fds <= 0. So sleep. */ diff --git a/tests/libtest/lib518.c b/tests/libtest/lib518.c index d0c200774..1c858ee35 100644 --- a/tests/libtest/lib518.c +++ b/tests/libtest/lib518.c @@ -32,7 +32,7 @@ #define NUM_OPEN (FD_SETSIZE + 10) #define NUM_NEEDED (NUM_OPEN + 16) -#if (defined(WIN32) || defined(_WIN32) || defined(MSDOS)) && !defined(__CYGWIN__) +#if defined(WIN32) || defined(_WIN32) || defined(MSDOS) #define DEV_NULL "NUL" #else #define DEV_NULL "/dev/null" diff --git a/tests/server/resolve.c b/tests/server/resolve.c index 98a3f4e08..b579d460e 100644 --- a/tests/server/resolve.c +++ b/tests/server/resolve.c @@ -112,7 +112,7 @@ int main(int argc, char *argv[]) return 0; } -#if defined(WIN32) && !defined(__CYGWIN__) +#ifdef WIN32 win32_init(); atexit(win32_cleanup); #endif diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c index 165ecf27a..bf60a2c64 100644 --- a/tests/server/sockfilt.c +++ b/tests/server/sockfilt.c @@ -552,7 +552,7 @@ int main(int argc, char *argv[]) } } -#if defined(WIN32) && !defined(__CYGWIN__) +#ifdef WIN32 win32_init(); atexit(win32_cleanup); #else diff --git a/tests/server/sws.c b/tests/server/sws.c index c2c681dfe..7f9091f4a 100644 --- a/tests/server/sws.c +++ b/tests/server/sws.c @@ -773,7 +773,7 @@ int main(int argc, char *argv[]) } } -#if defined(WIN32) && !defined(__CYGWIN__) +#ifdef WIN32 win32_init(); atexit(win32_cleanup); #else diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c index 5c3caf4f8..c234dbf19 100644 --- a/tests/server/tftpd.c +++ b/tests/server/tftpd.c @@ -458,7 +458,7 @@ int main(int argc, char **argv) } } -#if defined(WIN32) && !defined(__CYGWIN__) +#ifdef WIN32 win32_init(); atexit(win32_cleanup); #endif diff --git a/tests/server/util.c b/tests/server/util.c index 724cb8517..7bf8bdc82 100644 --- a/tests/server/util.c +++ b/tests/server/util.c @@ -65,7 +65,7 @@ const struct in6_addr in6addr_any = {{ IN6ADDR_ANY_INIT }}; */ int ourerrno(void) { -#if defined(WIN32) && !defined(__CYGWIN__) +#ifdef WIN32 return (int)GetLastError(); #else return errno; @@ -101,7 +101,7 @@ void logmsg(const char *msg, ...) } } -#if defined(REAL_WIN32) +#ifdef WIN32 /* use instead of perror() on generic windows */ void win32_perror (const char *msg) { @@ -145,7 +145,7 @@ void win32_cleanup(void) { WSACleanup(); } -#endif /* REAL_WIN32 */ +#endif /* WIN32 */ /* set by the main code to point to where the test dir is */ const char *path="."; diff --git a/tests/server/util.h b/tests/server/util.h index 30395fc4c..acda12159 100644 --- a/tests/server/util.h +++ b/tests/server/util.h @@ -38,10 +38,9 @@ void logmsg(const char *msg, ...); /* global variable, where to find the 'data' dir */ extern const char *path; -#if defined(WIN32) && !defined(__CYGWIN__) +#ifdef WIN32 #include #include -#define REAL_WIN32 #define sleep(sec) Sleep ((sec)*1000) @@ -57,7 +56,7 @@ void win32_perror (const char *msg); void win32_init(void); void win32_cleanup(void); -#endif /* WIN32 && !__CYGWIN__ */ +#endif /* WIN32 */ /* returns the path name to the test case file */ char *test2file(long testno);