diff options
author | Wojtek Kosior <wk@koszkonutek-tmp.pl.eu.org> | 2021-04-30 18:47:09 +0200 |
---|---|---|
committer | Wojtek Kosior <wk@koszkonutek-tmp.pl.eu.org> | 2021-04-30 18:47:09 +0200 |
commit | 35a201cc8ef0c3f5b2df88d2e528aabee1048348 (patch) | |
tree | 902dae955480e19f4498dbe4964619fc91d09b06 /libxml2-2.9.10/include/wsockcompat.h | |
download | xml-backup-restore-35a201cc8ef0c3f5b2df88d2e528aabee1048348.tar.gz xml-backup-restore-35a201cc8ef0c3f5b2df88d2e528aabee1048348.zip |
Diffstat (limited to 'libxml2-2.9.10/include/wsockcompat.h')
-rw-r--r-- | libxml2-2.9.10/include/wsockcompat.h | 54 |
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__ */ |