aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-02-15 14:16:55 +0000
committerMatthew Wild <mwild1@gmail.com>2010-02-15 14:16:55 +0000
commitdcf2339cc6e5820b0c8345475329ff53151a5945 (patch)
treea2a1f8a0cb03b23c57882ca0b9c9f9b9178f6d0c /src
parent5f7ea0a8dac6e279d4f15153f4833df1793a9c74 (diff)
downloadluaevent-prosody-dcf2339cc6e5820b0c8345475329ff53151a5945.tar.gz
luaevent-prosody-dcf2339cc6e5820b0c8345475329ff53151a5945.zip
luaevent.c: Fix for backwards-compatibility with 1.3
Diffstat (limited to 'src')
-rw-r--r--src/luaevent.c8
1 files changed, 7 insertions, 1 deletions
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 <lauxlib.h>
#include <assert.h>
+#include <string.h>
#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;
}