summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--adapters/libev.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/adapters/libev.h b/adapters/libev.h
index 6191543..c59d3da 100644
--- a/adapters/libev.h
+++ b/adapters/libev.h
@@ -66,8 +66,9 @@ static void redisLibevWriteEvent(EV_P_ ev_io *watcher, int revents) {
static void redisLibevAddRead(void *privdata) {
redisLibevEvents *e = (redisLibevEvents*)privdata;
+#if EV_MULTIPLICITY
struct ev_loop *loop = e->loop;
- ((void)loop);
+#endif
if (!e->reading) {
e->reading = 1;
ev_io_start(EV_A_ &e->rev);
@@ -76,8 +77,9 @@ static void redisLibevAddRead(void *privdata) {
static void redisLibevDelRead(void *privdata) {
redisLibevEvents *e = (redisLibevEvents*)privdata;
+#if EV_MULTIPLICITY
struct ev_loop *loop = e->loop;
- ((void)loop);
+#endif
if (e->reading) {
e->reading = 0;
ev_io_stop(EV_A_ &e->rev);
@@ -86,8 +88,9 @@ static void redisLibevDelRead(void *privdata) {
static void redisLibevAddWrite(void *privdata) {
redisLibevEvents *e = (redisLibevEvents*)privdata;
+#if EV_MULTIPLICITY
struct ev_loop *loop = e->loop;
- ((void)loop);
+#endif
if (!e->writing) {
e->writing = 1;
ev_io_start(EV_A_ &e->wev);
@@ -96,8 +99,9 @@ static void redisLibevAddWrite(void *privdata) {
static void redisLibevDelWrite(void *privdata) {
redisLibevEvents *e = (redisLibevEvents*)privdata;
+#if EV_MULTIPLICITY
struct ev_loop *loop = e->loop;
- ((void)loop);
+#endif
if (e->writing) {
e->writing = 0;
ev_io_stop(EV_A_ &e->wev);
@@ -106,8 +110,9 @@ static void redisLibevDelWrite(void *privdata) {
static void redisLibevStopTimer(void *privdata) {
redisLibevEvents *e = (redisLibevEvents*)privdata;
+#if EV_MULTIPLICITY
struct ev_loop *loop = e->loop;
- ((void)loop);
+#endif
ev_timer_stop(EV_A_ &e->timer);
}
@@ -120,6 +125,9 @@ static void redisLibevCleanup(void *privdata) {
}
static void redisLibevTimeout(EV_P_ ev_timer *timer, int revents) {
+#if EV_MULTIPLICITY
+ ((void)EV_A);
+#endif
((void)revents);
redisLibevEvents *e = (redisLibevEvents*)timer->data;
redisAsyncHandleTimeout(e->context);
@@ -127,8 +135,9 @@ static void redisLibevTimeout(EV_P_ ev_timer *timer, int revents) {
static void redisLibevSetTimeout(void *privdata, struct timeval tv) {
redisLibevEvents *e = (redisLibevEvents*)privdata;
+#if EV_MULTIPLICITY
struct ev_loop *loop = e->loop;
- ((void)loop);
+#endif
if (!ev_is_active(&e->timer)) {
ev_init(&e->timer, redisLibevTimeout);