aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorIgor Zlatkovic <igor@src.gnome.org>2002-09-29 17:53:19 +0000
committerIgor Zlatkovic <igor@src.gnome.org>2002-09-29 17:53:19 +0000
commit9524c2325d08275920bf933fa16ccf5f151c5712 (patch)
tree7cd2427cee1b788cf0953ef8841ebc6b2908eba3 /include
parentddce4427abe7c99bf42e31adde1db90b4b3740ef (diff)
downloadandroid_external_libxml2-9524c2325d08275920bf933fa16ccf5f151c5712.tar.gz
android_external_libxml2-9524c2325d08275920bf933fa16ccf5f151c5712.tar.bz2
android_external_libxml2-9524c2325d08275920bf933fa16ccf5f151c5712.zip
outsourced WinSock compatibility macros
Diffstat (limited to 'include')
-rw-r--r--include/libxml/xmlwin32version.h81
-rw-r--r--include/wsockcompat.h61
2 files changed, 117 insertions, 25 deletions
diff --git a/include/libxml/xmlwin32version.h b/include/libxml/xmlwin32version.h
index 2e71f3b6..4f2a493e 100644
--- a/include/libxml/xmlwin32version.h
+++ b/include/libxml/xmlwin32version.h
@@ -1,6 +1,5 @@
/*
- * xmlwin32version.h : compile-time version informations for the XML parser
- * when compiled on the Windows platform
+ * xmlversion.h : compile-time version informations for the XML parser.
*
* See Copyright for the status of this software.
*
@@ -51,6 +50,7 @@ extern void xmlCheckVersion(int version);
*/
#define LIBXML_TEST_VERSION xmlCheckVersion(20425);
+#ifndef VMS
#if 0
/**
* WITH_TRIO:
@@ -66,6 +66,9 @@ extern void xmlCheckVersion(int version);
*/
#define WITHOUT_TRIO
#endif
+#else /* VMS */
+#define WITH_TRIO 1
+#endif /* VMS */
/**
* LIBXML_THREAD_ENABLED:
@@ -73,8 +76,10 @@ extern void xmlCheckVersion(int version);
* Whether the thread support is configured in
*/
#if 0
+#if defined(_REENTRANT) || (_POSIX_C_SOURCE - 0 >= 199506L)
#define LIBXML_THREAD_ENABLED
#endif
+#endif
/**
* LIBXML_FTP_ENABLED:
@@ -104,6 +109,15 @@ extern void xmlCheckVersion(int version);
#endif
/**
+ * LIBXML_C14N_ENABLED:
+ *
+ * Whether the Canonicalization support is configured in
+ */
+#if 1
+#define LIBXML_C14N_ENABLED
+#endif
+
+/**
* LIBXML_CATALOG_ENABLED:
*
* Whether the Catalog support is configured in
@@ -140,15 +154,6 @@ extern void xmlCheckVersion(int version);
#endif
/**
- * LIBXML_C14N_ENABLED:
- *
- * Whether the Canonicalization support is configured in
- */
-#if 0
-#define LIBXML_C14N_ENABLED
-#endif
-
-/**
* LIBXML_XINCLUDE_ENABLED:
*
* Whether XInclude is configured in
@@ -162,7 +167,7 @@ extern void xmlCheckVersion(int version);
*
* Whether iconv support is available
*/
-#if 0
+#if 1
#define LIBXML_ICONV_ENABLED
#endif
@@ -185,6 +190,42 @@ extern void xmlCheckVersion(int version);
#endif
/**
+ * LIBXML_UNICODE_ENABLED
+ *
+ * Whether the Unicode related interfaces are compiled in
+ */
+#if 1
+#define LIBXML_UNICODE_ENABLED
+#endif
+
+/**
+ * LIBXML_REGEXP_ENABLED
+ *
+ * Whether the regular expressions interfaces are compiled in
+ */
+#if 1
+#define LIBXML_REGEXP_ENABLED
+#endif
+
+/**
+ * LIBXML_AUTOMATA_ENABLED
+ *
+ * Whether the automata interfaces are compiled in
+ */
+#if 1
+#define LIBXML_AUTOMATA_ENABLED
+#endif
+
+/**
+ * LIBXML_SCHEMAS_ENABLED
+ *
+ * Whether the Schemas validation interfaces are compiled in
+ */
+#if 1
+#define LIBXML_SCHEMAS_ENABLED
+#endif
+
+/**
* LIBXML_DLL_IMPORT:
*
* Used on Windows (MS C compiler only) to declare a variable as
@@ -200,7 +241,7 @@ extern void xmlCheckVersion(int version);
* code which links against libxml statically.
*/
#ifndef LIBXML_DLL_IMPORT
-#if defined(_MSC_VER) && !defined(IN_LIBXML) && !defined(LIBXML_STATIC)
+#if (defined(_MSC_VER) || defined(__CYGWIN__)) && !defined(IN_LIBXML) && !defined(LIBXML_STATIC)
#define LIBXML_DLL_IMPORT __declspec(dllimport)
#else
#define LIBXML_DLL_IMPORT
@@ -223,19 +264,9 @@ extern void xmlCheckVersion(int version);
#define ATTRIBUTE_UNUSED
#endif
-/**
- * #pragma comment(lib, "iconv.lib")
- *
- * pragma understood my MS compiler which enables a conditional link with
- * iconv.
- */
-#ifdef _MSC_VER
-#if defined LIBXML_ICONV_ENABLED && !defined LIBXML2_COMPILING_MSCCDEF
-#pragma comment(lib, "iconv.lib")
-#endif
-#endif
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif
+
+
diff --git a/include/wsockcompat.h b/include/wsockcompat.h
new file mode 100644
index 00000000..690048ce
--- /dev/null
+++ b/include/wsockcompat.h
@@ -0,0 +1,61 @@
+/* include/wsockcompat.h
+ * Windows -> Berkeley Sockets compatibility things.
+ */
+
+#if !defined __XML_WSOCKCOMPAT_H__
+#define __XML_WSOCKCOMPAT_H__
+
+#ifdef _WIN32_WCE
+#include <winsock.h>
+#else
+#undef HAVE_ERRNO_H
+#include <winsock2.h>
+#endif
+
+#if !defined SOCKLEN_T
+#define SOCKLEN_T int
+#endif
+
+#define EWOULDBLOCK WSAEWOULDBLOCK
+#define EINPROGRESS WSAEINPROGRESS
+#define EALREADY WSAEALREADY
+#define ENOTSOCK WSAENOTSOCK
+#define EDESTADDRREQ WSAEDESTADDRREQ
+#define EMSGSIZE WSAEMSGSIZE
+#define EPROTOTYPE WSAEPROTOTYPE
+#define ENOPROTOOPT WSAENOPROTOOPT
+#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
+#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
+#define EOPNOTSUPP WSAEOPNOTSUPP
+#define EPFNOSUPPORT WSAEPFNOSUPPORT
+#define EAFNOSUPPORT WSAEAFNOSUPPORT
+#define EADDRINUSE WSAEADDRINUSE
+#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
+#define ENETDOWN WSAENETDOWN
+#define ENETUNREACH WSAENETUNREACH
+#define ENETRESET WSAENETRESET
+#define ECONNABORTED WSAECONNABORTED
+#define ECONNRESET WSAECONNRESET
+#define ENOBUFS WSAENOBUFS
+#define EISCONN WSAEISCONN
+#define ENOTCONN WSAENOTCONN
+#define ESHUTDOWN WSAESHUTDOWN
+#define ETOOMANYREFS WSAETOOMANYREFS
+#define ETIMEDOUT WSAETIMEDOUT
+#define ECONNREFUSED WSAECONNREFUSED
+#define ELOOP WSAELOOP
+#define EHOSTDOWN WSAEHOSTDOWN
+#define EHOSTUNREACH WSAEHOSTUNREACH
+#define EPROCLIM WSAEPROCLIM
+#define EUSERS WSAEUSERS
+#define EDQUOT WSAEDQUOT
+#define ESTALE WSAESTALE
+#define EREMOTE WSAEREMOTE
+/* These cause conflicts with the codes from errno.h. Since they are
+ not used in the relevant code (nanoftp, nanohttp), we can leave
+ them disabled.
+#define ENAMETOOLONG WSAENAMETOOLONG
+#define ENOTEMPTY WSAENOTEMPTY
+*/
+
+#endif /* __XML_WSOCKCOMPAT_H__ */