Applied following patches from Robert Collins and make sure IN_LIBXML is

* libxml.h: Applied following patches from Robert Collins
  and make sure IN_LIBXML is defined when compiling it
-------
* include/libxml/xmlversion.h.in (LIBXML_DLL_IMPORT): Use on Cygwin
  as well as Visual C.
* parser.c (XML_DIR_SEP): Don't use '\\' for Cygwin.
* parserInternals.c (XML_DIR_SEP): Don't use '\\' for Cygwin.
* strio.c (PLATFORM_UNIX): Define for Cygwin.
* triodef.h (TRIO_PLATFORM_UNIX): Define for Cygwin.
* xmlIO.c (xmlFileOpen): Use unix behaviour for Cygwin.
  Use binary mode opens for Cygwin (xmlFileOpenW xmlParserGetDirectory
  xmlSysIDExists xmlNoNetExists).
* xmllint.c: Don't include winsock2.h for Cygwin.
Daniel
diff --git a/xmlIO.c b/xmlIO.c
index bfa8096..1bad043 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -294,7 +294,7 @@
     if (!strncmp(filename, "file://localhost", 16))
 	path = &filename[16];
     else if (!strncmp(filename, "file:///", 8)) {
-#ifdef _WIN32
+#if defined (_WIN32) && !defined(__CYGWIN__)
 	path = &filename[8];
 #else
 	path = &filename[7];
@@ -307,7 +307,7 @@
     if (!xmlCheckFilename(path))
         return(NULL);
 
-#ifdef WIN32
+#if defined(WIN32) || defined (__CYGWIN__)
     fd = fopen(path, "rb");
 #else
     fd = fopen(path, "r");
@@ -337,7 +337,7 @@
     if (!strncmp(filename, "file://localhost", 16))
 	path = &filename[16];
     else if (!strncmp(filename, "file:///", 8)) {
-#ifdef _WIN32
+#if defined (_WIN32) && !defined(__CYGWIN__)
 	path = &filename[8];
 #else
 	path = &filename[7];
@@ -454,7 +454,7 @@
     if (!strncmp(filename, "file://localhost", 16))
 	path = &filename[16];
     else if (!strncmp(filename, "file:///", 8)) {
-#ifdef _WIN32
+#if defined (_WIN32) && !defined(__CYGWIN__)
 	path = &filename[8];
 #else
 	path = &filename[7];
@@ -496,7 +496,7 @@
     if (!strncmp(filename, "file://localhost", 16))
 	path = &filename[16];
     else if (!strncmp(filename, "file:///", 8)) {
-#ifdef _WIN32
+#if defined (_WIN32) && !defined(__CYGWIN__)
 	path = &filename[8];
 #else
 	path = &filename[7];
@@ -2387,7 +2387,7 @@
 	xmlRegisterDefaultInputCallbacks();
 
     if (filename == NULL) return(NULL);
-#ifdef WIN32
+#if defined(WIN32) && !defined(__CYGWIN__)
     sep = '\\';
 #endif
 
@@ -2430,7 +2430,7 @@
     if (!strncmp(URL, "file://localhost", 16))
 	path = &URL[16];
     else if (!strncmp(URL, "file:///", 8)) {
-#ifdef _WIN32
+#if defined (_WIN32) && !defined(__CYGWIN__)
 	path = &URL[8];
 #else
 	path = &URL[7];
@@ -2617,7 +2617,7 @@
     if (!xmlStrncmp(BAD_CAST URL, BAD_CAST "file://localhost", 16))
         path = &URL[16];
     else if (!xmlStrncmp(BAD_CAST URL, BAD_CAST "file:///", 8)) {
-#ifdef _WIN32
+#if defined (_WIN32) && !defined(__CYGWIN__)
         path = &URL[8];
 #else
         path = &URL[7];