summarylogtreecommitdiffstats
path: root/libquvi-0.9.4-lua52.patch
blob: 15a62d2e097ba3a8bc09b5ee8a1de59efb330b79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
diff -rauN libquvi-0.9.4/src/lua/init.c libquvi-0.9.4-lua52-patch/src/lua/init.c
--- libquvi-0.9.4/src/lua/init.c	2013-11-04 13:55:26.000000000 +0100
+++ libquvi-0.9.4-lua52-patch/src/lua/init.c	2026-05-17 10:56:09.127134800 +0200
@@ -80,10 +80,21 @@
     return (QUVI_ERROR_LUA_INIT);
 
   luaL_openlibs(q->handle.lua);
+#if LUA_VERSION_NUM < 502
   luaL_register(q->handle.lua, "quvi", quvi_reg_meth);
   luaL_register(q->handle.lua, "quvi.http", quvi_http_reg_meth);
   luaL_register(q->handle.lua, "quvi.crypto", quvi_crypto_reg_meth);
   luaL_register(q->handle.lua, "quvi.base64", quvi_base64_reg_meth);
+#else
+  luaL_newlib(q->handle.lua, quvi_reg_meth);
+  lua_setglobal(q->handle.lua, "quvi");
+  luaL_newlib(q->handle.lua, quvi_http_reg_meth);
+  lua_setglobal(q->handle.lua, "quvi.http");
+  luaL_newlib(q->handle.lua, quvi_crypto_reg_meth);
+  lua_setglobal(q->handle.lua, "quvi.crypto");
+  luaL_newlib(q->handle.lua, quvi_base64_reg_meth);
+  lua_setglobal(q->handle.lua, "quvi.base64");
+#endif
 
   return (QUVI_OK);
 }