|
That what I have in linit.c (and works for 5.3):
static const luaL_Reg loadedlibs[] = {
{"_G", luaopen_base}, {LUA_LOADLIBNAME, luaopen_package}, {LUA_COLIBNAME, luaopen_coroutine}, {LUA_TABLIBNAME, luaopen_table}, {LUA_IOLIBNAME, luaopen_io}, {LUA_OSLIBNAME, luaopen_os}, {LUA_STRLIBNAME, luaopen_string}, {LUA_MATHLIBNAME, luaopen_math}, {LUA_UTF8LIBNAME, luaopen_utf8}, {LUA_DBLIBNAME, luaopen_debug}, #if defined(LUA_COMPAT_BITLIB) {LUA_BITLIBNAME, luaopen_bit32}, #endif {LUA_LFSLIBNAME, luaopen_lfs}, {LUA_SQLITE3LIBNAME, luaopen_lsqlite3}, {NULL, NULL} }; Should it be different for
v5.4?
From: Gé Weijers
Sent: Wednesday, May 13, 2020 11:42 PM
To: Lua mailing list
Subject: Re: Lua v5.4 one.c? And, module inclusion
issue. On Wed, May 13, 2020 at 1:05 PM Tony Papadimitriou
<tonyp@acm.org> wrote:
The easiest way is adding the modules' luaopen_<name> functions to
the table in 'linit.c', perhaps they're missing there?
Personally I prefer to assign the luaopen_... functions to the
package.preload table (LUA_PRELOAD_TABLE in the registry). The modules won't
pollute the global namespace and will only be activated if 'require' is called
for them. I'm trying to keep the time required to create a new lua state
low.
Gé
_______________________________________________ lua-l mailing list -- lua-l@lists.lua.org To unsubscribe send an email to lua-l-leave@lists.lua.org |
_______________________________________________ lua-l mailing list -- lua-l@lists.lua.org To unsubscribe send an email to lua-l-leave@lists.lua.org