'debug' library is loaded by default

This commit is contained in:
Roberto Ierusalimschy 2010-11-12 13:48:30 -02:00
parent a1952d9c41
commit 8c21f463ed
2 changed files with 7 additions and 18 deletions

View File

@ -1,5 +1,5 @@
/* /*
** $Id: linit.c,v 1.28 2010/07/02 11:38:13 roberto Exp roberto $ ** $Id: linit.c,v 1.29 2010/10/25 14:32:36 roberto Exp roberto $
** Initialization of libraries for lua.c and other clients ** Initialization of libraries for lua.c and other clients
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -36,9 +36,7 @@ static const luaL_Reg loadedlibs[] = {
{LUA_STRLIBNAME, luaopen_string}, {LUA_STRLIBNAME, luaopen_string},
{LUA_BITLIBNAME, luaopen_bit32}, {LUA_BITLIBNAME, luaopen_bit32},
{LUA_MATHLIBNAME, luaopen_math}, {LUA_MATHLIBNAME, luaopen_math},
#if defined(LUA_COMPAT_DEBUGLIB)
{LUA_DBLIBNAME, luaopen_debug}, {LUA_DBLIBNAME, luaopen_debug},
#endif
{NULL, NULL} {NULL, NULL}
}; };
@ -47,7 +45,6 @@ static const luaL_Reg loadedlibs[] = {
** these libs are preloaded and must be required before used ** these libs are preloaded and must be required before used
*/ */
static const luaL_Reg preloadedlibs[] = { static const luaL_Reg preloadedlibs[] = {
{LUA_DBLIBNAME, luaopen_debug},
{NULL, NULL} {NULL, NULL}
}; };

View File

@ -1,5 +1,5 @@
/* /*
** $Id: luaconf.h,v 1.149 2010/11/03 15:16:17 roberto Exp roberto $ ** $Id: luaconf.h,v 1.150 2010/11/10 17:38:10 roberto Exp roberto $
** Configuration file for Lua ** Configuration file for Lua
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -229,7 +229,7 @@
** You can define it to get all options, or change specific options ** You can define it to get all options, or change specific options
** to fit your specific needs. ** to fit your specific needs.
*/ */
#if defined(LUA_COMPAT_ALL) #if defined(LUA_COMPAT_ALL) /* { */
/* /*
@@ LUA_COMPAT_UNPACK controls the presence of global 'unpack'. @@ LUA_COMPAT_UNPACK controls the presence of global 'unpack'.
@ -238,8 +238,8 @@
#define LUA_COMPAT_UNPACK #define LUA_COMPAT_UNPACK
/* /*
@@ LUA_COMPAT_CPCALL controls the presence of macro 'lua_cpcall'. @@ macro 'lua_cpcall' emulates deprecated function lua_cpcall.
** You can call your C function directly (with light C functions) ** You can call your C function directly (with light C functions).
*/ */
#define lua_cpcall(L,f,u) \ #define lua_cpcall(L,f,u) \
(lua_pushcfunction(L, (f)), \ (lua_pushcfunction(L, (f)), \
@ -258,14 +258,6 @@
*/ */
#define LUA_COMPAT_MAXN #define LUA_COMPAT_MAXN
/*
@@ LUA_COMPAT_DEBUGLIB controls compatibility with preloading
** the debug library.
** You should add 'require"debug"' everywhere you need the debug
** library.
*/
#define LUA_COMPAT_DEBUGLIB
/* /*
@@ The following macros supply trivial compatibility for some @@ The following macros supply trivial compatibility for some
** changes in the API. The macros themselves document how to ** changes in the API. The macros themselves document how to
@ -275,7 +267,7 @@
#define lua_objlen(L,i) lua_rawlen(L, (i)) #define lua_objlen(L,i) lua_rawlen(L, (i))
#define lua_equal(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPEQ) #define lua_equal(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPEQ)
#define lua_lessthan(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPLT) #define lua_lessthan(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPLT)
/* /*
@ -284,7 +276,7 @@
*/ */
#define LUA_COMPAT_MODULE #define LUA_COMPAT_MODULE
#endif /* LUA_COMPAT_ALL */ #endif /* } */
/* }================================================================== */ /* }================================================================== */