ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.c
(Generate patch)

Comparing libev/ev.c (file contents):
Revision 1.255 by root, Mon Jun 9 14:11:30 2008 UTC vs.
Revision 1.259 by root, Mon Sep 8 13:14:23 2008 UTC

154#ifndef _WIN32 154#ifndef _WIN32
155# include <sys/time.h> 155# include <sys/time.h>
156# include <sys/wait.h> 156# include <sys/wait.h>
157# include <unistd.h> 157# include <unistd.h>
158#else 158#else
159# include <io.h>
159# define WIN32_LEAN_AND_MEAN 160# define WIN32_LEAN_AND_MEAN
160# include <windows.h> 161# include <windows.h>
161# ifndef EV_SELECT_IS_WINSOCKET 162# ifndef EV_SELECT_IS_WINSOCKET
162# define EV_SELECT_IS_WINSOCKET 1 163# define EV_SELECT_IS_WINSOCKET 1
163# endif 164# endif
564 struct timeval tv; 565 struct timeval tv;
565 566
566 tv.tv_sec = (time_t)delay; 567 tv.tv_sec = (time_t)delay;
567 tv.tv_usec = (long)((delay - (ev_tstamp)(tv.tv_sec)) * 1e6); 568 tv.tv_usec = (long)((delay - (ev_tstamp)(tv.tv_sec)) * 1e6);
568 569
570 /* here we rely on sys/time.h + sys/types.h + unistd.h providing select */
571 /* somehting nto guaranteed by newer posix versions, but guaranteed */
572 /* by older ones */
569 select (0, 0, 0, 0, &tv); 573 select (0, 0, 0, 0, &tv);
570#endif 574#endif
571 } 575 }
572} 576}
573 577
1507{ 1511{
1508 postfork = 1; /* must be in line with ev_default_fork */ 1512 postfork = 1; /* must be in line with ev_default_fork */
1509} 1513}
1510 1514
1511#if EV_VERIFY 1515#if EV_VERIFY
1512void noinline 1516static void noinline
1513verify_watcher (EV_P_ W w) 1517verify_watcher (EV_P_ W w)
1514{ 1518{
1515 assert (("watcher has invalid priority", ABSPRI (w) >= 0 && ABSPRI (w) < NUMPRI)); 1519 assert (("watcher has invalid priority", ABSPRI (w) >= 0 && ABSPRI (w) < NUMPRI));
1516 1520
1517 if (w->pending) 1521 if (w->pending)
2978once_cb (EV_P_ struct ev_once *once, int revents) 2982once_cb (EV_P_ struct ev_once *once, int revents)
2979{ 2983{
2980 void (*cb)(int revents, void *arg) = once->cb; 2984 void (*cb)(int revents, void *arg) = once->cb;
2981 void *arg = once->arg; 2985 void *arg = once->arg;
2982 2986
2983 ev_io_stop (EV_A_ &once->io); 2987 ev_io_stop (EV_A_ &once->io);
2984 ev_timer_stop (EV_A_ &once->to); 2988 ev_timer_stop (EV_A_ &once->to);
2985 ev_free (once); 2989 ev_free (once);
2986 2990
2987 cb (revents, arg); 2991 cb (revents, arg);
2988} 2992}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines