aboutsummaryrefslogtreecommitdiff
path: root/libxml2-2.9.10/include/wsockcompat.h
diff options
context:
space:
mode:
Diffstat (limited to 'libxml2-2.9.10/include/wsockcompat.h')
-rw-r--r--libxml2-2.9.10/include/wsockcompat.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/libxml2-2.9.10/include/wsockcompat.h b/libxml2-2.9.10/include/wsockcompat.h
new file mode 100644
index 0000000..e57ca8e
--- /dev/null
+++ b/libxml2-2.9.10/include/wsockcompat.h
@@ -0,0 +1,54 @@
+/* include/wsockcompat.h
+ * Windows -> Berkeley Sockets compatibility things.
+ */
+
+#if !defined __XML_WSOCKCOMPAT_H__
+#define __XML_WSOCKCOMPAT_H__
+
+#ifdef _WIN32_WCE
+#include <winsock.h>
+#else
+#include <errno.h>
+#include <winsock2.h>
+
+/* Fix for old MinGW. */
+#ifndef _WINSOCKAPI_
+#define _WINSOCKAPI_
+#endif
+
+/* the following is a workaround a problem for 'inline' keyword in said
+ header when compiled with Borland C++ 6 */
+#if defined(__BORLANDC__) && !defined(__cplusplus)
+#define inline __inline
+#define _inline __inline
+#endif
+
+#include <ws2tcpip.h>
+
+/* Check if ws2tcpip.h is a recent version which provides getaddrinfo() */
+#if defined(GetAddrInfo)
+#include <wspiapi.h>
+#define HAVE_GETADDRINFO
+#endif
+#endif
+
+#undef XML_SOCKLEN_T
+#define XML_SOCKLEN_T int
+
+#ifndef ECONNRESET
+#define ECONNRESET WSAECONNRESET
+#endif
+#ifndef EINPROGRESS
+#define EINPROGRESS WSAEINPROGRESS
+#endif
+#ifndef EINTR
+#define EINTR WSAEINTR
+#endif
+#ifndef ESHUTDOWN
+#define ESHUTDOWN WSAESHUTDOWN
+#endif
+#ifndef EWOULDBLOCK
+#define EWOULDBLOCK WSAEWOULDBLOCK
+#endif
+
+#endif /* __XML_WSOCKCOMPAT_H__ */