build: fix build on MinGW32

This commit is contained in:
mattn 2014-06-23 16:30:24 +09:00 committed by Saúl Ibarra Corretgé
parent 636b108d37
commit b17223cd60
3 changed files with 24 additions and 0 deletions

View File

@ -30,6 +30,15 @@ typedef intptr_t ssize_t;
#endif
#include <winsock2.h>
#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
typedef struct pollfd {
SOCKET fd;
short events;
short revents;
} WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD;
#endif
#include <mswsock.h>
#include <ws2tcpip.h>
#include <windows.h>

View File

@ -27,6 +27,17 @@
#include "internal.h"
#include "req-inl.h"
#ifndef GetNameInfo
int WSAAPI GetNameInfoW(
const SOCKADDR *pSockaddr,
socklen_t SockaddrLength,
PWCHAR pNodeBuffer,
DWORD NodeBufferSize,
PWCHAR pServiceBuffer,
DWORD ServiceBufferSize,
INT Flags
);
#endif
static void uv__getnameinfo_work(struct uv__work* w) {
uv_getnameinfo_t* req;

View File

@ -30,6 +30,10 @@
# include <stdint.h>
#endif
#ifndef COMMON_LVB_REVERSE_VIDEO
# define COMMON_LVB_REVERSE_VIDEO 0x4000
#endif
#include "uv.h"
#include "internal.h"
#include "handle-inl.h"