diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2022-02-28 22:42:10 +0100 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2022-02-28 22:58:35 +0100 |
commit | 2489c1d024906d0f72bbcf709aeb53a24602c219 (patch) | |
tree | 922084fc7995dbb0d5d36482d921ebc97decede4 | |
parent | ea6e8f998dc1a4d465fb8d44c4fad93940ca8280 (diff) | |
download | libxml2-2489c1d024906d0f72bbcf709aeb53a24602c219.tar.gz |
Remove useless __CYGWIN__ checks
From what I can tell, some really early Cygwin versions from around
1998-2000 used to erroneously define _WIN32. This was eventually fixed,
but these days, the `defined(_WIN32) && !defined(__CYGWIN__)` idiom is
unnecessary.
Now, we only check for __CYGWIN__ in xmlexports.h when deciding whether
to use __declspec.
-rw-r--r-- | include/libxml/nanoftp.h | 2 | ||||
-rw-r--r-- | nanoftp.c | 2 | ||||
-rw-r--r-- | nanohttp.c | 2 | ||||
-rw-r--r-- | parser.c | 2 | ||||
-rw-r--r-- | parserInternals.c | 2 | ||||
-rw-r--r-- | runsuite.c | 4 | ||||
-rw-r--r-- | runtest.c | 10 | ||||
-rw-r--r-- | runxmlconf.c | 4 | ||||
-rw-r--r-- | testHTML.c | 6 | ||||
-rw-r--r-- | testSAX.c | 4 | ||||
-rw-r--r-- | testlimits.c | 2 | ||||
-rw-r--r-- | testrecurse.c | 6 | ||||
-rw-r--r-- | uri.c | 6 | ||||
-rw-r--r-- | xmlIO.c | 42 | ||||
-rw-r--r-- | xmllint.c | 6 | ||||
-rw-r--r-- | xmlmodule.c | 2 |
16 files changed, 51 insertions, 51 deletions
diff --git a/include/libxml/nanoftp.h b/include/libxml/nanoftp.h index 37f47d77..f39bde5b 100644 --- a/include/libxml/nanoftp.h +++ b/include/libxml/nanoftp.h @@ -17,7 +17,7 @@ #ifdef LIBXML_FTP_ENABLED /* Needed for portability to Windows 64 bits */ -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) #include <winsock2.h> #else /** @@ -75,7 +75,7 @@ #endif -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) #include <wsockcompat.h> #endif @@ -73,7 +73,7 @@ #define XML_SOCKLEN_T unsigned int #endif -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) #include <wsockcompat.h> #endif @@ -38,7 +38,7 @@ #define IN_LIBXML #include "libxml.h" -#if defined(_WIN32) && !defined (__CYGWIN__) +#if defined(_WIN32) #define XML_DIR_SEP '\\' #else #define XML_DIR_SEP '/' diff --git a/parserInternals.c b/parserInternals.c index 270270b2..1421681c 100644 --- a/parserInternals.c +++ b/parserInternals.c @@ -10,7 +10,7 @@ #define IN_LIBXML #include "libxml.h" -#if defined(_WIN32) && !defined (__CYGWIN__) +#if defined(_WIN32) #define XML_DIR_SEP '\\' #else #define XML_DIR_SEP '/' @@ -9,7 +9,7 @@ #include "libxml.h" #include <stdio.h> -#if !defined(_WIN32) || defined(__CYGWIN__) +#if !defined(_WIN32) #include <unistd.h> #endif #include <string.h> @@ -48,7 +48,7 @@ static int checkTestFile(const char *filename) { if (stat(filename, &buf) == -1) return(0); -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) if (!(buf.st_mode & _S_IFREG)) return(0); #else @@ -14,7 +14,7 @@ #include "libxml.h" #include <stdio.h> -#if !defined(_WIN32) || defined(__CYGWIN__) +#if !defined(_WIN32) #include <unistd.h> #endif #include <string.h> @@ -108,7 +108,7 @@ static int update_results = 0; static char* temp_directory = NULL; static int checkTestFile(const char *filename); -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) #include <windows.h> #include <io.h> @@ -599,7 +599,7 @@ static int checkTestFile(const char *filename) { if (stat(filename, &buf) == -1) return(0); -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) if (!(buf.st_mode & _S_IFREG)) return(0); #else @@ -4105,7 +4105,7 @@ thread_specific_data(void *private_data) return(NULL); } -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) #include <windows.h> #include <string.h> @@ -4631,7 +4631,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { int i, a, ret = 0; int subset = 0; -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) setvbuf(stdout, NULL, _IONBF, 0); setvbuf(stderr, NULL, _IONBF, 0); #endif diff --git a/runxmlconf.c b/runxmlconf.c index 8a37aa8f..7196c28a 100644 --- a/runxmlconf.c +++ b/runxmlconf.c @@ -11,7 +11,7 @@ #ifdef LIBXML_XPATH_ENABLED -#if !defined(_WIN32) || defined(__CYGWIN__) +#if !defined(_WIN32) #include <unistd.h> #endif #include <string.h> @@ -53,7 +53,7 @@ static int checkTestFile(const char *filename) { if (stat(filename, &buf) == -1) return(0); -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) if (!(buf.st_mode & _S_IFREG)) return(0); #else @@ -627,7 +627,7 @@ parseSAXFile(char *filename) { if (push) { FILE *f; -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +#if defined(_WIN32) || defined (__DJGPP__) f = fopen(filename, "rb"); #else f = fopen(filename, "r"); @@ -657,7 +657,7 @@ parseSAXFile(char *filename) { fclose(f); } if (!noout) { -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +#if defined(_WIN32) || defined (__DJGPP__) f = fopen(filename, "rb"); #else f = fopen(filename, "r"); @@ -721,7 +721,7 @@ parseAndPrintFile(char *filename) { if (push) { FILE *f; -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +#if defined(_WIN32) || defined (__DJGPP__) f = fopen(filename, "rb"); #else f = fopen(filename, "r"); @@ -1012,7 +1012,7 @@ parseAndPrintFile(char *filename) { /* * Empty callbacks for checking */ -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +#if defined(_WIN32) || defined (__DJGPP__) f = fopen(filename, "rb"); #else f = fopen(filename, "r"); @@ -1041,7 +1041,7 @@ parseAndPrintFile(char *filename) { /* * Debug callback */ -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +#if defined(_WIN32) || defined (__DJGPP__) f = fopen(filename, "rb"); #else f = fopen(filename, "r"); diff --git a/testlimits.c b/testlimits.c index 059116a6..0b045eac 100644 --- a/testlimits.c +++ b/testlimits.c @@ -13,7 +13,7 @@ #include "libxml.h" #include <stdio.h> -#if !defined(_WIN32) || defined(__CYGWIN__) +#if !defined(_WIN32) #include <unistd.h> #endif #include <string.h> diff --git a/testrecurse.c b/testrecurse.c index 0cbe25a6..fabc5138 100644 --- a/testrecurse.c +++ b/testrecurse.c @@ -13,7 +13,7 @@ #include "libxml.h" #include <stdio.h> -#if !defined(_WIN32) || defined(__CYGWIN__) +#if !defined(_WIN32) #include <unistd.h> #endif #include <string.h> @@ -56,7 +56,7 @@ struct testDesc { static int checkTestFile(const char *filename); -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) #include <windows.h> #include <io.h> @@ -643,7 +643,7 @@ static int checkTestFile(const char *filename) { if (stat(filename, &buf) == -1) return(0); -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) if (!(buf.st_mode & _S_IFREG)) return(0); #else @@ -2383,7 +2383,7 @@ xmlCanonicPath(const xmlChar *path) * For Windows implementations, additional work needs to be done to * replace backslashes in pathnames with "forward slashes" */ -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) int len = 0; char *p = NULL; #endif @@ -2455,7 +2455,7 @@ xmlCanonicPath(const xmlChar *path) path_processing: /* For Windows implementations, replace backslashes with 'forward slashes' */ -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) /* * Create a URI structure */ @@ -2534,7 +2534,7 @@ xmlPathToURI(const xmlChar *path) cal = xmlCanonicPath(path); if (cal == NULL) return(NULL); -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) /* xmlCanonicPath can return an URI on Windows (is that the intended behaviour?) If 'cal' is a valid URI already then we are done here, as continuing would make it invalid. */ @@ -40,7 +40,7 @@ #include <lzma.h> #endif -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) #define WIN32_LEAN_AND_MEAN #include <windows.h> #endif @@ -190,7 +190,7 @@ static const char *IOerr[] = { "unknown address family", /* EAFNOSUPPORT */ }; -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +#if defined(_WIN32) || defined (__DJGPP__) /** * __xmlIOWin32UTF8ToWChar: * @u8String: uft-8 string @@ -595,7 +595,7 @@ xmlPopOutputCallbacks(void) * * ************************************************************************/ -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +#if defined(_WIN32) || defined (__DJGPP__) /** * xmlWrapOpenUtf8: @@ -696,7 +696,7 @@ int xmlCheckFilename (const char *path) { #ifdef HAVE_STAT -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +#if defined(_WIN32) || defined (__DJGPP__) struct _stat stat_buffer; #else struct stat stat_buffer; @@ -706,7 +706,7 @@ xmlCheckFilename (const char *path) return(0); #ifdef HAVE_STAT -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +#if defined(_WIN32) || defined (__DJGPP__) /* * On Windows stat and wstat do not work with long pathname, * which start with '\\?\' @@ -837,20 +837,20 @@ xmlFileOpen_real (const char *filename) { } if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file://localhost/", 17)) { -#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__) +#if defined (_WIN32) || defined (__DJGPP__) path = &filename[17]; #else path = &filename[16]; #endif } else if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file:///", 8)) { -#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__) +#if defined (_WIN32) || defined (__DJGPP__) path = &filename[8]; #else path = &filename[7]; #endif } else if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file:/", 6)) { /* lots of generators seems to lazy to read RFC 1738 */ -#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__) +#if defined (_WIN32) || defined (__DJGPP__) path = &filename[6]; #else path = &filename[5]; @@ -863,7 +863,7 @@ xmlFileOpen_real (const char *filename) { return(NULL); #endif -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +#if defined(_WIN32) || defined (__DJGPP__) fd = xmlWrapOpenUtf8(path, 0); #else fd = fopen(path, "r"); @@ -919,13 +919,13 @@ xmlFileOpenW (const char *filename) { } if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file://localhost/", 17)) -#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__) +#if defined (_WIN32) || defined (__DJGPP__) path = &filename[17]; #else path = &filename[16]; #endif else if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file:///", 8)) { -#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__) +#if defined (_WIN32) || defined (__DJGPP__) path = &filename[8]; #else path = &filename[7]; @@ -936,7 +936,7 @@ xmlFileOpenW (const char *filename) { if (path == NULL) return(NULL); -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +#if defined(_WIN32) || defined (__DJGPP__) fd = xmlWrapOpenUtf8(path, 1); #elif(__MVS__) fd = fopen(path, "w"); @@ -1109,13 +1109,13 @@ xmlGzfileOpen_real (const char *filename) { } if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file://localhost/", 17)) -#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__) +#if defined (_WIN32) || defined (__DJGPP__) path = &filename[17]; #else path = &filename[16]; #endif else if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file:///", 8)) { -#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__) +#if defined (_WIN32) || defined (__DJGPP__) path = &filename[8]; #else path = &filename[7]; @@ -1128,7 +1128,7 @@ xmlGzfileOpen_real (const char *filename) { if (!xmlCheckFilename(path)) return(NULL); -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +#if defined(_WIN32) || defined (__DJGPP__) fd = xmlWrapGzOpenUtf8(path, "rb"); #else fd = gzopen(path, "rb"); @@ -1188,13 +1188,13 @@ xmlGzfileOpenW (const char *filename, int compression) { } if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file://localhost/", 17)) -#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__) +#if defined (_WIN32) || defined (__DJGPP__) path = &filename[17]; #else path = &filename[16]; #endif else if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file:///", 8)) { -#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__) +#if defined (_WIN32) || defined (__DJGPP__) path = &filename[8]; #else path = &filename[7]; @@ -1205,7 +1205,7 @@ xmlGzfileOpenW (const char *filename, int compression) { if (path == NULL) return(NULL); -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +#if defined(_WIN32) || defined (__DJGPP__) fd = xmlWrapGzOpenUtf8(path, mode); #else fd = gzopen(path, mode); @@ -3774,7 +3774,7 @@ xmlParserGetDirectory(const char *filename) { if (filename == NULL) return(NULL); -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) # define IS_XMLPGD_SEP(ch) ((ch=='/')||(ch=='\\')) #else # define IS_XMLPGD_SEP(ch) (ch=='/') @@ -3891,13 +3891,13 @@ static int xmlNoNetExists(const char *URL) { return(0); if (!xmlStrncasecmp(BAD_CAST URL, BAD_CAST "file://localhost/", 17)) -#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__) +#if defined (_WIN32) || defined (__DJGPP__) path = &URL[17]; #else path = &URL[16]; #endif else if (!xmlStrncasecmp(BAD_CAST URL, BAD_CAST "file:///", 8)) { -#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__) +#if defined (_WIN32) || defined (__DJGPP__) path = &URL[8]; #else path = &URL[7]; @@ -2202,7 +2202,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { if ((filename[0] == '-') && (filename[1] == 0)) { f = stdin; } else { -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +#if defined(_WIN32) || defined (__DJGPP__) f = fopen(filename, "rb"); #elif defined(__OS400__) f = fopen(filename, "rb"); @@ -2278,7 +2278,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { if ((filename[0] == '-') && (filename[1] == 0)) { f = stdin; } else { -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +#if defined(_WIN32) || defined (__DJGPP__) f = fopen(filename, "rb"); #elif defined(__OS400__) f = fopen(filename, "rb"); @@ -2327,7 +2327,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { } else { FILE *f; -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +#if defined(_WIN32) || defined (__DJGPP__) f = fopen(filename, "rb"); #elif defined(__OS400__) f = fopen(filename, "rb"); diff --git a/xmlmodule.c b/xmlmodule.c index 82bf1339..592c1c7e 100644 --- a/xmlmodule.c +++ b/xmlmodule.c @@ -301,7 +301,7 @@ xmlModulePlatformSymbol(void *handle, const char *name, void **symbol) #endif /* HAVE_SHLLOAD */ #endif /* ! HAVE_DLOPEN */ -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) #define WIN32_LEAN_AND_MEAN #include <windows.h> |