From 460968353f602af5986e706ff776c80455f1f8fa Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Sat, 6 Dec 2014 18:42:58 -0200 Subject: [PATCH] in test mode, debug library is not predefined (to allow testing 'preloadedlibs') --- linit.c | 9 +++++++-- ltests.h | 5 ++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/linit.c b/linit.c index 96378037..304c8093 100644 --- a/linit.c +++ b/linit.c @@ -1,5 +1,5 @@ /* -** $Id: linit.c,v 1.34 2014/05/15 19:28:34 roberto Exp roberto $ +** $Id: linit.c,v 1.35 2014/11/02 19:19:04 roberto Exp roberto $ ** Initialization of libraries for lua.c and other clients ** See Copyright Notice in lua.h */ @@ -37,8 +37,10 @@ static const luaL_Reg loadedlibs[] = { {LUA_OSLIBNAME, luaopen_os}, {LUA_STRLIBNAME, luaopen_string}, {LUA_MATHLIBNAME, luaopen_math}, - {LUA_DBLIBNAME, luaopen_debug}, {LUA_UTF8LIBNAME, luaopen_utf8}, +#if !defined(LUA_NODEBUGLIB) + {LUA_DBLIBNAME, luaopen_debug}, +#endif #if defined(LUA_COMPAT_BITLIB) {LUA_BITLIBNAME, luaopen_bit32}, #endif @@ -50,6 +52,9 @@ static const luaL_Reg loadedlibs[] = { ** these libs are preloaded and must be required before used */ static const luaL_Reg preloadedlibs[] = { +#if defined(LUA_NODEBUGLIB) + {LUA_DBLIBNAME, luaopen_debug}, +#endif {NULL, NULL} }; diff --git a/ltests.h b/ltests.h index 6a55e2db..0f9a4bc9 100644 --- a/ltests.h +++ b/ltests.h @@ -1,5 +1,5 @@ /* -** $Id: ltests.h,v 2.41 2014/11/24 14:56:56 roberto Exp roberto $ +** $Id: ltests.h,v 2.42 2014/11/29 19:45:37 roberto Exp roberto $ ** Internal Header for Debugging of the Lua Implementation ** See Copyright Notice in lua.h */ @@ -24,6 +24,9 @@ #undef LUA_COMPAT_MODULE +/* test without preloding debug library */ +#define LUA_NODEBUGLIB + #define LUA_DEBUG