lua

A copy of the Lua development repository
Log | Files | Refs | README

commit d41c36bf67d6628bccd91697e7f88e55d40d3970
parent d9d2904f09a8039522dfd6f118d4e37bffd5bdf6
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Thu,  3 Dec 2020 10:39:11 -0300

'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.

Diffstat:
Mlauxlib.h | 12++++++++++++
Mlualib.h | 6------
2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/lauxlib.h b/lauxlib.h @@ -158,6 +158,18 @@ LUALIB_API void (luaL_requiref) (lua_State *L, const char *modname, /* +** Internal assertions for in-house debugging +*/ +#if defined LUAI_ASSERT +#include <assert.h> +#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 @@ -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