diff options
Diffstat (limited to 'ev.h')
-rw-r--r-- | ev.h | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -515,7 +515,7 @@ void ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revent } while (0) #define ev_io_set(ev,fd_,events_) do { (ev)->fd = (fd_); (ev)->events = (events_) | EV_IOFDSET; } while (0) -#define ev_timer_set(ev,after_,repeat_) do { (ev)->at = (after_); (ev)->repeat = (repeat_); } while (0) +#define ev_timer_set(ev,after_,repeat_) do { ((ev_watcher_time *)(ev))->at = (after_); (ev)->repeat = (repeat_); } while (0) #define ev_periodic_set(ev,ofs_,ival_,res_) do { (ev)->offset = (ofs_); (ev)->interval = (ival_); (ev)->reschedule_cb= (res_); } while (0) #define ev_signal_set(ev,signum_) do { (ev)->signum = (signum_); } while (0) #define ev_child_set(ev,pid_,trace_) do { (ev)->pid = (pid_); (ev)->flags = !!(trace_); } while (0) @@ -547,6 +547,8 @@ void ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revent #define ev_cb(ev) (ev)->cb /* rw */ #define ev_set_priority(ev,pri) ((ev_watcher *)(void *)(ev))->priority = (pri) +#define ev_periodic_at(ev) (((ev_watcher_time *)(ev))->at + 0.) + #ifndef ev_set_cb # define ev_set_cb(ev,cb_) ev_cb (ev) = (cb_) #endif |