From 595370fdc4d106d093184893c037ec00e9abcae9 Mon Sep 17 00:00:00 2001 From: Dennis Schridde Date: Tue, 18 Sep 2012 15:57:41 +0200 Subject: [PATCH] Lua 5.1 compatibility fallbacks --- inotify.c | 4 ++++ lsyncd.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/inotify.c b/inotify.c index ac6f7d9..518c329 100644 --- a/inotify.c +++ b/inotify.c @@ -39,6 +39,10 @@ #include #include +#if LUA_VERSION_NUM < 502 +# define luaL_newlib(L,l) luaL_register(L,NULL,l) +#endif + /*----------------------------------------------------------------------------- * Event types. */ diff --git a/lsyncd.c b/lsyncd.c index f7c61c2..74629bd 100644 --- a/lsyncd.c +++ b/lsyncd.c @@ -53,6 +53,12 @@ extern const char defaults_out[]; extern size_t defaults_size; +#if LUA_VERSION_NUM < 502 +/* lua_rawlen: Not entirely correct, but should work anyway */ +# define lua_rawlen lua_objlen +# define luaL_newlib(L,l) luaL_register(L,NULL,l) +#endif + /** * Makes sure there is one monitor. */ -- 1.7.10