ws2 defines and missing prototypes for building withmingw32

This commit is contained in:
Andrew Tonner 2017-01-19 21:12:35 -08:00
parent d3b56d8e32
commit 2f9bc272be
2 changed files with 31 additions and 0 deletions

View File

@ -2,7 +2,16 @@
#define _LIBSLIRP_H
#ifdef _WIN32
#ifdef __MINGW32__
#if _WIN32_WINNT < 0x501
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x501
#endif
#endif
#include <winsock2.h>
#ifdef __MINGW32__
#include <WS2tcpip.h>
#endif
int inet_aton(const char *cp, struct in_addr *ia);
#else
#include <sys/select.h>

View File

@ -22,8 +22,30 @@ typedef char *caddr_t;
typedef int socklen_t;
typedef unsigned long ioctlsockopt_t;
#ifdef __MINGW32__
#if _WIN32_WINNT < 0x501
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x501
#endif
#endif
# include <winsock2.h>
# include <WS2tcpip.h>
#ifdef __MINGW32__
char * WSAAPI inet_ntop(
INT Family,
PVOID pAddr,
PTSTR pStringBuf,
size_t StringBufSize
);
INT WSAAPI inet_pton(
INT Family,
const char * pszAddrString,
PVOID pAddrBuf
);
#endif
# include <sys/timeb.h>
# include <iphlpapi.h>