Commit bf549a24 authored by devsaurus's avatar devsaurus
Browse files

make ldblib.c compilable with extended debug support

parent dc0c6ff6
...@@ -301,6 +301,7 @@ static int db_gethook (lua_State *L) { ...@@ -301,6 +301,7 @@ static int db_gethook (lua_State *L) {
} }
#if defined(LUA_CROSS_COMPILER)
static int db_debug (lua_State *L) { static int db_debug (lua_State *L) {
for (;;) { for (;;) {
char buffer[LUA_MAXINPUT]; char buffer[LUA_MAXINPUT];
...@@ -325,6 +326,7 @@ static int db_debug (lua_State *L) { ...@@ -325,6 +326,7 @@ static int db_debug (lua_State *L) {
lua_settop(L, 0); /* remove eventual returns */ lua_settop(L, 0); /* remove eventual returns */
} }
} }
#endif // defined(LUA_CROSS_COMPILER)
#endif #endif
#define LEVELS1 12 /* size of the first part of the stack */ #define LEVELS1 12 /* size of the first part of the stack */
...@@ -387,7 +389,9 @@ static int db_errorfb (lua_State *L) { ...@@ -387,7 +389,9 @@ static int db_errorfb (lua_State *L) {
#include "lrodefs.h" #include "lrodefs.h"
const LUA_REG_TYPE dblib[] = { const LUA_REG_TYPE dblib[] = {
#ifndef CONFIG_LUA_BUILTIN_DEBUG_MINIMAL #ifndef CONFIG_LUA_BUILTIN_DEBUG_MINIMAL
#if defined(LUA_CROSS_COMPILER)
{LSTRKEY("debug"), LFUNCVAL(db_debug)}, {LSTRKEY("debug"), LFUNCVAL(db_debug)},
#endif // defined(LUA_CROSS_COMPILER)
{LSTRKEY("getfenv"), LFUNCVAL(db_getfenv)}, {LSTRKEY("getfenv"), LFUNCVAL(db_getfenv)},
{LSTRKEY("gethook"), LFUNCVAL(db_gethook)}, {LSTRKEY("gethook"), LFUNCVAL(db_gethook)},
{LSTRKEY("getinfo"), LFUNCVAL(db_getinfo)}, {LSTRKEY("getinfo"), LFUNCVAL(db_getinfo)},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment