From d41c36bf67d6628bccd91697e7f88e55d40d3970 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 3 Dec 2020 10:39:38 -0300 Subject: 'lua_assert' moved from 'lualib.h' to 'lauxlib.h' The macro is useful also in 'lauxlib.c', which does not include 'lualib.h'. Also, the definition was corrected to be "on" when LUAI_ASSERT is defined. --- lauxlib.h | 12 ++++++++++++ lualib.h | 6 ------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lauxlib.h b/lauxlib.h index 59fef6af..df3de4f8 100644 --- a/lauxlib.h +++ b/lauxlib.h @@ -157,6 +157,18 @@ LUALIB_API void (luaL_requiref) (lua_State *L, const char *modname, #define luaL_pushfail(L) lua_pushnil(L) +/* +** Internal assertions for in-house debugging +*/ +#if defined LUAI_ASSERT +#include +#define lua_assert(c) assert(c) +#else +#define lua_assert(x) ((void)0) +#endif + + + /* ** {====================================================== ** Generic Buffer manipulation diff --git a/lualib.h b/lualib.h index eb08b530..26255290 100644 --- a/lualib.h +++ b/lualib.h @@ -49,10 +49,4 @@ LUAMOD_API int (luaopen_package) (lua_State *L); LUALIB_API void (luaL_openlibs) (lua_State *L); - -#if !defined(lua_assert) -#define lua_assert(x) ((void)0) -#endif - - #endif -- cgit v1.2.3-55-g6feb