Mon, 15 Feb 2010 14:16:55 +0000
luaevent.c: Fix for backwards-compatibility with 1.3
src/luaevent.c | file | annotate | diff | comparison | revisions |
--- a/src/luaevent.c Mon Feb 15 14:15:36 2010 +0000 +++ b/src/luaevent.c Mon Feb 15 14:16:55 2010 +0000 @@ -7,6 +7,7 @@ #include <lauxlib.h> #include <assert.h> +#include <string.h> #define EVENT_BASE_MT "EVENT_BASE_MT" @@ -105,8 +106,13 @@ } 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; }