From f99fc29e62c6375d1d09967c64723f3c1fbd675a Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Fri, 4 Feb 2011 23:21:00 +0100 Subject: [PATCH] Fix mingw build --- TODO.win32 | 1 + src/node_net.cc | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/TODO.win32 b/TODO.win32 index 191729f383..e8c9d98fe3 100644 --- a/TODO.win32 +++ b/TODO.win32 @@ -5,6 +5,7 @@ - Better `net` support * getaddrinfo + * setMulticastTTL, setMembership, setLoopback * pipe, socketpair * A named pipe should be provided when a unix socket is requested. * SendMsg and RecvMsg should be supported with named pipes. diff --git a/src/node_net.cc b/src/node_net.cc index 80d1f7963c..17f4687953 100644 --- a/src/node_net.cc +++ b/src/node_net.cc @@ -1395,6 +1395,9 @@ static Handle SetTTL(const Arguments& args) { return scope.Close(Integer::New(newttl)); } + +#ifdef __POSIX__ + static Handle SetMulticastTTL(const Arguments& args) { HandleScope scope; @@ -1492,6 +1495,9 @@ static Handle DropMembership(const Arguments& args) { return SetMembership(args, IP_DROP_MEMBERSHIP); } +#endif // __POSIX__ + + // // G E T A D D R I N F O // @@ -1722,10 +1728,12 @@ void InitNet(Handle target) { NODE_SET_METHOD(target, "setBroadcast", SetBroadcast); NODE_SET_METHOD(target, "setTTL", SetTTL); NODE_SET_METHOD(target, "setKeepAlive", SetKeepAlive); +#ifdef __POSIX__ NODE_SET_METHOD(target, "setMulticastTTL", SetMulticastTTL); NODE_SET_METHOD(target, "setMulticastLoopback", SetMulticastLoopback); NODE_SET_METHOD(target, "addMembership", AddMembership); NODE_SET_METHOD(target, "dropMembership", DropMembership); +#endif // __POSIX__ NODE_SET_METHOD(target, "getsockname", GetSockName); NODE_SET_METHOD(target, "getpeername", GetPeerName); NODE_SET_METHOD(target, "getaddrinfo", GetAddrInfo);