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