From b17223cd607718abcd79610a6bd2057f523df971 Mon Sep 17 00:00:00 2001 From: mattn Date: Mon, 23 Jun 2014 16:30:24 +0900 Subject: [PATCH] build: fix build on MinGW32 --- include/uv-win.h | 9 +++++++++ src/win/getnameinfo.c | 11 +++++++++++ src/win/tty.c | 4 ++++ 3 files changed, 24 insertions(+) diff --git a/include/uv-win.h b/include/uv-win.h index 23b42324..9bc0962f 100644 --- a/include/uv-win.h +++ b/include/uv-win.h @@ -30,6 +30,15 @@ typedef intptr_t ssize_t; #endif #include + +#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) +typedef struct pollfd { + SOCKET fd; + short events; + short revents; +} WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD; +#endif + #include #include #include diff --git a/src/win/getnameinfo.c b/src/win/getnameinfo.c index c1aae13f..b8bf23b8 100644 --- a/src/win/getnameinfo.c +++ b/src/win/getnameinfo.c @@ -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; diff --git a/src/win/tty.c b/src/win/tty.c index 87e3eb5d..6b8297cb 100644 --- a/src/win/tty.c +++ b/src/win/tty.c @@ -30,6 +30,10 @@ # include #endif +#ifndef COMMON_LVB_REVERSE_VIDEO +# define COMMON_LVB_REVERSE_VIDEO 0x4000 +#endif + #include "uv.h" #include "internal.h" #include "handle-inl.h"