New interface to function 'luaL_openselectedlibs'

Instead of preloading all non-loaded libraries, there is another
mask to select which libraries to preload.
This commit is contained in:
Roberto Ierusalimschy
2024-02-15 11:17:39 -03:00
parent c8121ce34b
commit 165389b27b
8 changed files with 80 additions and 56 deletions

2
lua.c
View File

@@ -618,7 +618,7 @@ static void doREPL (lua_State *L) {
/* }================================================================== */
#if !defined(luai_openlibs)
#define luai_openlibs(L) luaL_openlibs(L)
#define luai_openlibs(L) luaL_openselectedlibs(L, ~0, 0)
#endif