[vlc-devel] [PATCH 3/5] lua: wrap luaL_register since Lua 5.2

Alexandre Janniaux ajanni at videolabs.io
Mon Apr 6 15:56:02 CEST 2020


luaL_setfuncs exists since lua5.2 and luaL_register was already
deprecated at that version. Using the luaL_register since Lua 5.2
prevents using the deprecated function but mostly also enforce the
future state of the code to be used on more platforms.
---
 modules/lua/vlc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/lua/vlc.h b/modules/lua/vlc.h
index 36bcc25aad..e6dea213d1 100644
--- a/modules/lua/vlc.h
+++ b/modules/lua/vlc.h
@@ -48,7 +48,7 @@
 # define lua_strlen(L,idx)         lua_rawlen(L,idx)
 #endif
 
-#if LUA_VERSION_NUM >= 503
+#if LUA_VERSION_NUM >= 502
 # undef luaL_register
 # define luaL_register(L, n, l) luaL_setfuncs(L, (l), 0)
 # define luaL_register_namespace(L, n, l) \
-- 
2.26.0



More information about the vlc-devel mailing list