X-Git-Url: https://git.llucax.com/software/libev.git/blobdiff_plain/228b0b302ab0857b23efad5a8b2429de2c0ccc00..36ed1953891a670e15f5e113491596630f21676c:/event.c diff --git a/event.c b/event.c index b1c335e..1c2bc73 100644 --- a/event.c +++ b/event.c @@ -35,11 +35,19 @@ #include "event.h" -#define dLOOPev -#define dLOOPbase +#ifdef EV_MULTIPLICITY +# define dLOOPev struct ev_loop *loop = ev->ev_base->loop +# define dLOOPbase struct ev_loop *loop = base->loop +#else +# define dLOOPev +# define dLOOPbase +#endif struct event_base { +#ifdef EV_MULTIPLICITY + struct ev_loop *loop; +#endif int dummy; }; @@ -83,6 +91,8 @@ void *event_init (void) void event_base_free (struct event_base *base) { + dLOOPbase; + /* nop */ } @@ -265,7 +275,8 @@ int event_base_set (struct event_base *base, struct event *ev) int event_base_loop (struct event_base *base, int flags) { dLOOPbase; - ev_loop (EV_A_ flags | EVLOOP_ONESHOT); + + ev_loop (EV_A_ flags); return 0; }