summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root>2010-01-07 06:49:31 +0000
committerroot <root>2010-01-07 06:49:31 +0000
commit3028813ce7dc27507d93efb7fb347044fed5ac1c (patch)
treef0a1ac5d678182599a9530a3381addea02a6bda7
parent4e991360fc37173dc588d897fed1bfda7f8eabf7 (diff)
*** empty log message ***
-rw-r--r--Changes2
-rw-r--r--ev.c10
2 files changed, 7 insertions, 5 deletions
diff --git a/Changes b/Changes
index a9e0ac4..c187382 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,7 @@
Revision history for libev, a high-performance and full-featured event loop.
+ - applied win32 fixes by Michael Lenaghan.
+
3.9 Thu Dec 31 07:59:59 CET 2009
- signalfd is no longer used by default and has to be requested
explicitly - this means that easy to catch bugs become hard to
diff --git a/ev.c b/ev.c
index ccd202b..64ad61e 100644
--- a/ev.c
+++ b/ev.c
@@ -507,7 +507,7 @@ static EV_ATOMIC_T have_monotonic; /* did clock_gettime (CLOCK_MONOTONIC) work?
# define EV_FD_TO_WIN32_HANDLE(fd) _get_osfhandle (fd)
#endif
#ifndef EV_WIN32_HANDLE_TO_FD
-# define EV_WIN32_HANDLE_TO_FD(handle) _open_osfhandle (fd, 0)
+# define EV_WIN32_HANDLE_TO_FD(handle) _open_osfhandle (handle, 0)
#endif
#ifndef EV_WIN32_CLOSE_FD
# define EV_WIN32_CLOSE_FD(fd) close (fd)
@@ -966,7 +966,7 @@ inline_size int
fd_valid (int fd)
{
#ifdef _WIN32
- return _get_osfhandle (fd) != -1;
+ return EV_FD_TO_WIN32_HANDLE (fd) != -1;
#else
return fcntl (fd, F_GETFD) != -1;
#endif
@@ -1181,7 +1181,7 @@ fd_intern (int fd)
{
#ifdef _WIN32
unsigned long arg = 1;
- ioctlsocket (_get_osfhandle (fd), FIONBIO, &arg);
+ ioctlsocket (EV_FD_TO_WIN32_HANDLE (fd), FIONBIO, &arg);
#else
fcntl (fd, F_SETFD, FD_CLOEXEC);
fcntl (fd, F_SETFL, O_NONBLOCK);
@@ -1296,7 +1296,7 @@ ev_sighandler (int signum)
EV_P = signals [signum - 1].loop;
#endif
-#if _WIN32
+#ifdef _WIN32
signal (signum, ev_sighandler);
#endif
@@ -2749,7 +2749,7 @@ ev_signal_start (EV_P_ ev_signal *w)
if (sigfd < 0) /*TODO*/
# endif
{
-# if _WIN32
+# ifdef _WIN32
evpipe_init (EV_A);
signal (w->signum, ev_sighandler);