summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Renner Berthing <esmil@mailme.dk>2012-07-14 20:20:06 +0200
committerEmil Renner Berthing <esmil@mailme.dk>2012-07-14 23:24:26 +0200
commit5e7f7cdd888b1f55e3fc834be0bfbe0ae3bdf62c (patch)
treec6b20631f86d572ddb8267facc1a306c3fe44487
parent77275eae72bfe082be94615dea32a350a49001b6 (diff)
downloadlem-5e7f7cdd888b1f55e3fc834be0bfbe0ae3bdf62c.tar.gz
lem-5e7f7cdd888b1f55e3fc834be0bfbe0ae3bdf62c.tar.xz
lem-5e7f7cdd888b1f55e3fc834be0bfbe0ae3bdf62c.zip
use LEM and LEM_ for global loop
-rw-r--r--lem.c8
-rw-r--r--macros.h8
-rw-r--r--utils.c8
3 files changed, 12 insertions, 12 deletions
diff --git a/lem.c b/lem.c
index 94cb9e0..22f91fe 100644
--- a/lem.c
+++ b/lem.c
@@ -159,7 +159,7 @@ lem_queue(lua_State *T, int nargs)
nargs, nargs == 1 ? "" : "s");
if (rq.first == rq.last)
- ev_idle_start(EV_G_ &rq.w);
+ ev_idle_start(LEM_ &rq.w);
slot = &rq.queue[rq.last];
slot->T = T;
@@ -289,7 +289,7 @@ lem_exit(int status)
{
rq.status = status;
- ev_unloop(EV_G_ EVUNLOOP_ALL);
+ ev_unloop(LEM_ EVUNLOOP_ALL);
}
static int
@@ -355,7 +355,7 @@ main(int argc, char *argv[])
/* initialize runqueue */
ev_idle_init(&rq.w, runqueue_pop);
- ev_idle_start(EV_G_ &rq.w);
+ ev_idle_start(LEM_ &rq.w);
rq.queue = lem_xmalloc(LEM_INITIAL_QUEUESIZE
* sizeof(struct lem_runqueue_slot));
rq.first = rq.last = 0;
@@ -367,7 +367,7 @@ main(int argc, char *argv[])
goto error;
/* start the mainloop */
- ev_loop(EV_G_ 0);
+ ev_loop(LEM_ 0);
lem_debug("event loop exited");
/* if there is an error message left on L print it */
diff --git a/macros.h b/macros.h
index 897a013..6958b76 100644
--- a/macros.h
+++ b/macros.h
@@ -38,9 +38,9 @@
#endif
#if EV_MULTIPLICITY
-# define EV_G lem_loop
-# define EV_G_ EV_G,
+# define LEM lem_loop
+# define LEM_ LEM,
#else
-# define EV_G
-# define EV_G_
+# define LEM
+# define LEM_
#endif
diff --git a/utils.c b/utils.c
index 9d62d86..3fc82de 100644
--- a/utils.c
+++ b/utils.c
@@ -35,7 +35,7 @@ sleeper_wakeup(lua_State *T)
return 2;
}
- ev_timer_stop(EV_G_ w);
+ ev_timer_stop(LEM_ w);
nargs = lua_gettop(T) - 1;
lua_settop(S, 0);
@@ -87,7 +87,7 @@ sleeper_sleep(lua_State *T)
}
ev_timer_set(w, delay, 0);
- ev_timer_start(EV_G_ w);
+ ev_timer_start(LEM_ w);
}
w->data = T;
@@ -130,7 +130,7 @@ timer_cancel(lua_State *T)
return 2;
}
- ev_timer_stop(EV_G_ w);
+ ev_timer_stop(LEM_ w);
lem_forgetthread(S);
/* return true */
@@ -178,7 +178,7 @@ timer_new(lua_State *T)
lua_xmove(T, S, 1);
ev_timer_init(w, timer_handler, delay, 0);
- ev_timer_start(EV_G_ w);
+ ev_timer_start(LEM_ w);
} else {
w->data = NULL;