[vlc-devel] [PATCH] VLC 3.0 lua: fix build with lua 5.4

Alexandre Janniaux ajanni at videolabs.io
Tue Mar 2 11:41:46 UTC 2021


Hi

Maybe it's better to directly backport 0e0b070c26d197e848f1548fca455bf97db471a3
since luaL_checkinteger was already available in 5.1? Otherwise
your patch should have the same effect as enabling -DLUA_COMPAT_5_2 or
-DLUA_COMPAT_APIINTCASTS

    @@ LUA_COMPAT_APIINTCASTS controls the presence of macros for
    ** manipulating other integer types (lua_pushunsigned, lua_tounsigned,
    ** luaL_checkint, luaL_checklong, etc.)
    */
    #define LUA_COMPAT_APIINTCASTS

Regards,
--
Alexandre Janniaux
Videolabs


On Tue, Mar 02, 2021 at 12:07:51PM +0100, Francois Cartegnie wrote:
> ---
>  modules/lua/vlc.h | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/modules/lua/vlc.h b/modules/lua/vlc.h
> index 71f381d334..96fdd2bfa9 100644
> --- a/modules/lua/vlc.h
> +++ b/modules/lua/vlc.h
> @@ -66,6 +66,10 @@
>  # define luaL_register_namespace(L, n, l) luaL_register( L, n, (l) );
>  #endif
>
> +#if LUA_VERSION_NUM >= 504
> +# define luaL_checkint(L,narg)     ((int)luaL_checkinteger(L, (narg)))
> +# define luaL_optlong(L,narg,d)    ((long)luaL_optinteger(L, (narg), (d)))
> +#endif
>
>  /*****************************************************************************
>   * Module entry points
> --
> 2.29.2
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list