Module: kamailio
Branch: master
Commit: 937be943e8f261e5f5228e339e2fbb605b313156
URL:
https://github.com/kamailio/kamailio/commit/937be943e8f261e5f5228e339e2fbb6…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-02-08T08:36:50+01:00
app_lua_sr: define luaL_openlib for lua >=5.4 for custom exports
---
Modified: src/modules/app_lua_sr/app_lua_sr_api.c
Modified: src/modules/app_lua_sr/app_lua_sr_api.h
---
Diff:
https://github.com/kamailio/kamailio/commit/937be943e8f261e5f5228e339e2fbb6…
Patch:
https://github.com/kamailio/kamailio/commit/937be943e8f261e5f5228e339e2fbb6…
---
diff --git a/src/modules/app_lua_sr/app_lua_sr_api.c
b/src/modules/app_lua_sr/app_lua_sr_api.c
index 884330c604..aa74ea9efb 100644
--- a/src/modules/app_lua_sr/app_lua_sr_api.c
+++ b/src/modules/app_lua_sr/app_lua_sr_api.c
@@ -45,10 +45,6 @@
#include "app_lua_sr_api.h"
#include "app_lua_sr_exp.h"
-#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 504
-#define luaL_openlib ksr_luaL_openlib
-#endif
-
extern app_lua_api_t _app_lua_api;
diff --git a/src/modules/app_lua_sr/app_lua_sr_api.h
b/src/modules/app_lua_sr/app_lua_sr_api.h
index 726e4e9339..f700fb2fdf 100644
--- a/src/modules/app_lua_sr/app_lua_sr_api.h
+++ b/src/modules/app_lua_sr/app_lua_sr_api.h
@@ -35,5 +35,11 @@ void lua_sr_kemi_register_libs(lua_State *L);
int sr_kemi_lua_exec_func(lua_State* L, int eidx);
+#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 504
+void ksr_luaL_openlib(lua_State *L, const char *libname,
+ const luaL_Reg *lfuncs, int nup);
+#define luaL_openlib ksr_luaL_openlib
+#endif
+
#endif