From bfb1277b3496018b7ee12eca2fb900ebbe651b49 Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Fri, 22 Mar 2024 15:36:45 +0100 Subject: C++ migration: STACK_GROW is no longer a macro, sanitized and fixed warnings in keeper.cpp --- src/macros_and_utils.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/macros_and_utils.h') diff --git a/src/macros_and_utils.h b/src/macros_and_utils.h index 67213bc..9982693 100644 --- a/src/macros_and_utils.h +++ b/src/macros_and_utils.h @@ -5,6 +5,7 @@ extern "C" { #endif // __cplusplus #include "lua.h" #include "lualib.h" +#include "lauxlib.h" #ifdef __cplusplus } #endif // __cplusplus @@ -78,6 +79,10 @@ extern char const* debugspew_indent; #define ASSERT_L(c) _ASSERT_L(L,c) -#define STACK_GROW( L, n) do { if (!lua_checkstack(L,(int)(n))) luaL_error( L, "Cannot grow stack!" ); } while( 0) +inline void STACK_GROW(lua_State* L, int n_) +{ + if (!lua_checkstack(L, n_)) + luaL_error(L, "Cannot grow stack!"); +} #define LUAG_FUNC( func_name) int LG_##func_name( lua_State* L) -- cgit v1.2.3-55-g6feb