1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-22 10:45:15 +03:00
aports/community/lua-hiredis/0003-lua-5-2-compatibility.patch
Nathan Angelacos d68c23c524 community/lua-hiredis
APKBUILD: hiredis.so now loads correctly
 0003-: spell compatibility correctly
 0004-: add backward compatibility define for luaL_checkint for Lua 5.3+
2017-08-03 13:20:16 +00:00

36 lines
823 B
Diff

diff --git a/AUTHORS b/AUTHORS
index bd5ee8a..f10d214 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -8,3 +8,4 @@ lua-hiredis bindings contributors:
Stein Ivar Berghei <stein-ivar@berghei.no>
Peter Melnichenko <petjamelnik@yandex.ru>
+Andey Kunitsyn <blackicebox@gmail.com>
diff --git a/src/lua-hiredis.c b/src/lua-hiredis.c
index 3dfafc1..079cbd9 100644
--- a/src/lua-hiredis.c
+++ b/src/lua-hiredis.c
@@ -34,6 +34,22 @@ extern "C" {
#define LUAHIREDIS_KEY_NIL "NIL"
+#if LUA_VERSION_NUM >= 502
+static void luaL_register(lua_State * L, const char * name, const luaL_Reg * l)
+{
+ if (name)
+ {
+ lua_newtable(L);
+ luaL_setfuncs(L, l, 0);
+ lua_pushvalue(L,-1);
+ lua_setglobal(L,name);
+ } else
+ {
+ luaL_setfuncs(L,l,0);
+ }
+}
+#endif
+
typedef struct luahiredis_Enum
{
const char * name;