1 /* include/wsockcompat.h
2  * Windows -> Berkeley Sockets compatibility things.
3  */
4 
5 #if !defined __XML_WSOCKCOMPAT_H__
6 #define __XML_WSOCKCOMPAT_H__
7 
8 #ifdef _WIN32_WCE
9 #include <winsock.h>
10 #else
11 #include <errno.h>
12 #include <winsock2.h>
13 
14 /* Fix for old MinGW. */
15 #ifndef _WINSOCKAPI_
16 #define _WINSOCKAPI_
17 #endif
18 
19 /* the following is a workaround a problem for 'inline' keyword in said
20    header when compiled with Borland C++ 6 */
21 #if defined(__BORLANDC__) && !defined(__cplusplus)
22 #define inline __inline
23 #define _inline __inline
24 #endif
25 
26 #include <ws2tcpip.h>
27 
28 /* Check if ws2tcpip.h is a recent version which provides getaddrinfo() */
29 #if defined(GetAddrInfo)
30 #include <wspiapi.h>
31 #define HAVE_GETADDRINFO
32 #endif
33 #endif
34 
35 #undef XML_SOCKLEN_T
36 #define XML_SOCKLEN_T int
37 
38 #ifndef ECONNRESET
39 #define ECONNRESET WSAECONNRESET
40 #endif
41 #ifndef EINPROGRESS
42 #define EINPROGRESS WSAEINPROGRESS
43 #endif
44 #ifndef EINTR
45 #define EINTR WSAEINTR
46 #endif
47 #ifndef ESHUTDOWN
48 #define ESHUTDOWN WSAESHUTDOWN
49 #endif
50 #ifndef EWOULDBLOCK
51 #define EWOULDBLOCK WSAEWOULDBLOCK
52 #endif
53 
54 #endif /* __XML_WSOCKCOMPAT_H__ */
55