ReactOS 0.4.15-dev-8145-ga541a46
wsockcompat.h
Go to the documentation of this file.
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#define HAVE_GETADDRINFO
29#endif
30
31#undef XML_SOCKLEN_T
32#define XML_SOCKLEN_T int
33
34#ifndef ECONNRESET
35#define ECONNRESET WSAECONNRESET
36#endif
37#ifndef EINPROGRESS
38#define EINPROGRESS WSAEINPROGRESS
39#endif
40#ifndef EINTR
41#define EINTR WSAEINTR
42#endif
43#ifndef ESHUTDOWN
44#define ESHUTDOWN WSAESHUTDOWN
45#endif
46#ifndef EWOULDBLOCK
47#define EWOULDBLOCK WSAEWOULDBLOCK
48#endif
49
50#endif /* __XML_WSOCKCOMPAT_H__ */