lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi Antonin

Some years ago I wrote a small page on that subject, due to my efforts
with libraries such as LuaSQL, LuaExpat and others:

http://lua-users.org/wiki/CompatibilityWithLuaFive

I did not update it to Lua 5.3 but I think code targeted at Lua 5.2
will compile smoothly with Lua 5.3.  I hope it could be helpful.

Regards,
Tomás

Em dom, 7 de abr de 2019 às 15:41, Andrew Gierth
<andrew@tao11.riddles.org.uk> escreveu:
>
> >>>>> "Antonin" == Antonin Décimo <antonin.decimo@gmail.com> writes:
>
>  Antonin> The problem is with luaL_register. With 5.3, it is an alias
>  Antonin> for luaL_openlib, that is exported only if LUA_COMPAT_MODULE
>  Antonin> is defined during compilation, which neither Debian nor
>  Antonin> Homebrew seem to do.
>
> How about,
>
> #if LUA_VERSION_NUM < 502
> #define luaL_newlib(L_,f_) (lua_newtable(L_), luaL_register((L_),NULL,(f_)))
> #endif
>
> and use  luaL_newlib(L, fns);  where you currently have newtable/register
>
> --
> Andrew.
>