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