From 76f4dbf52e1bc85fd2d42fdb4c8caf0edc9df175 Mon Sep 17 00:00:00 2001 From: Emil Renner Berthing Date: Sat, 9 Feb 2013 19:58:00 +0100 Subject: fix compilation with EV_MULTIPLICITY set --- bin/lem.c | 10 +++++++++- bin/pool.c | 4 ++-- lem/utils.c | 4 ++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/bin/lem.c b/bin/lem.c index 67e79ac..387cd7f 100644 --- a/bin/lem.c +++ b/bin/lem.c @@ -386,8 +386,12 @@ main(int argc, char *argv[]) /* free runqueue */ free(rq.queue); - /* close default loop */ + /* destroy loop */ +#if EV_MULTIPLICITY + ev_loop_destroy(lem_loop); +#else ev_default_destroy(); +#endif lem_debug("Bye %s", exit_status == EXIT_SUCCESS ? "o/" : ":("); return exit_status; @@ -396,6 +400,10 @@ error: lua_close(L); if (rq.queue) free(rq.queue); +#if EV_MULTIPLICITY + ev_loop_destroy(lem_loop); +#else ev_default_destroy(); +#endif return EXIT_FAILURE; } diff --git a/bin/pool.c b/bin/pool.c index 66c20ae..d2b2df0 100644 --- a/bin/pool.c +++ b/bin/pool.c @@ -85,7 +85,7 @@ out: } static void -pool_cb(EV_A_ struct ev_async *w, int revents) +pool_cb(EV_P_ struct ev_async *w, int revents) { struct lem_async *a; struct lem_async *next; @@ -104,7 +104,7 @@ pool_cb(EV_A_ struct ev_async *w, int revents) } if (pool_jobs == 0) - ev_async_stop(LEM_ w); + ev_async_stop(EV_A_ w); } static int diff --git a/lem/utils.c b/lem/utils.c index 18e9c67..d49d639 100644 --- a/lem/utils.c +++ b/lem/utils.c @@ -181,7 +181,7 @@ utils_resume(lua_State *T) static int utils_now(lua_State *T) { - lua_pushnumber(T, (lua_Number)ev_now()); + lua_pushnumber(T, (lua_Number)ev_now(LEM)); return 1; } @@ -189,7 +189,7 @@ static int utils_updatenow(lua_State *T) { ev_now_update(LEM); - lua_pushnumber(T, (lua_Number)ev_now()); + lua_pushnumber(T, (lua_Number)ev_now(LEM)); return 1; } -- cgit v1.2.1