From dcf2339cc6e5820b0c8345475329ff53151a5945 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Mon, 15 Feb 2010 14:16:55 +0000 Subject: luaevent.c: Fix for backwards-compatibility with 1.3 --- src/luaevent.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/luaevent.c b/src/luaevent.c index 06b84c5..6036cf1 100644 --- a/src/luaevent.c +++ b/src/luaevent.c @@ -7,6 +7,7 @@ #include #include +#include #define EVENT_BASE_MT "EVENT_BASE_MT" @@ -105,8 +106,13 @@ static int luaevent_loopexit(lua_State*L) { } static int luaevent_method(lua_State* L) { + #ifdef _EVENT_VERSION le_base *base = event_base_get(L, 1); - lua_pushstring(L, event_base_get_method(base->base)); + if(strcmp(_EVENT_VERSION, "1.3")<0) + lua_pushstring(L, event_base_get_method(base->base)); + else + #endif + lua_pushstring(L, event_get_method()); return 1; } -- cgit v1.2.3