From 76f9bb395baaab9fe8ed7b390ee629028d10da61 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Thu, 10 Mar 2016 10:02:30 -0500 Subject: [PATCH 1/1] libevent: protect callbacks for compatibility with the light FFI MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/libevent.nit | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/libevent.nit b/lib/libevent.nit index c01d417..84d21d7 100644 --- a/lib/libevent.nit +++ b/lib/libevent.nit @@ -26,6 +26,7 @@ in "C header" `{ #include #include #include + #include #include #include @@ -34,6 +35,10 @@ in "C header" `{ `} in "C" `{ + +// Protect callbacks for compatibility with light FFI +#ifdef Connection_decr_ref + // Callback forwarded to 'Connection.write_callback' static void c_write_cb(struct bufferevent *bev, Connection ctx) { Connection_write_callback(ctx); @@ -58,6 +63,8 @@ in "C" `{ { ConnectionFactory_accept_connection(ctx, listener, fd, address, socklen); } +#endif + `} # Structure to hold information and state for a Libevent dispatch loop. -- 1.7.9.5