From 874321298bd5864326e2f830ee7d79dbf2782195 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Thu, 17 Feb 2011 04:06:41 +0100 Subject: [PATCH] Make libev work on MinGW again --- deps/libev/ev.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/deps/libev/ev.c b/deps/libev/ev.c index 4187b18..5f0391a 100644 --- a/deps/libev/ev.c +++ b/deps/libev/ev.c @@ -1337,12 +1337,12 @@ evpipe_write (EV_P_ EV_ATOMIC_T *flag) } else #endif - /* win32 people keep sending patches that change this write() to send() */ - /* and then run away. but send() is wrong, it wants a socket handle on win32 */ - /* so when you think this write should be a send instead, please find out */ - /* where your send() is from - it's definitely not the microsoft send, and */ - /* tell me. thank you. */ - write (evpipe [1], &dummy, 1); + +#ifdef __MINGW32__ + send(EV_FD_TO_WIN32_HANDLE(evpipe [1]), &dummy, 1, 0); +#else + write (evpipe [1], &dummy, 1); +#endif errno = old_errno; } @@ -1365,8 +1365,11 @@ pipecb (EV_P_ ev_io *iow, int revents) #endif { char dummy; - /* see discussion in evpipe_write when you think this read should be recv in win32 */ +#ifdef __MINGW32__ + recv(EV_FD_TO_WIN32_HANDLE(evpipe [0]), &dummy, 1, 0); +#else read (evpipe [0], &dummy, 1); +#endif } #if EV_SIGNAL_ENABLE -- 2.7.4