--- libev/ev.c 2009/12/31 06:50:17 1.321 +++ libev/ev.c 2010/01/07 06:49:31 1.322 @@ -507,7 +507,7 @@ # 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 @@ 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 @@ { #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_P = signals [signum - 1].loop; #endif -#if _WIN32 +#ifdef _WIN32 signal (signum, ev_sighandler); #endif @@ -2749,7 +2749,7 @@ if (sigfd < 0) /*TODO*/ # endif { -# if _WIN32 +# ifdef _WIN32 evpipe_init (EV_A); signal (w->signum, ev_sighandler);