aboutsummaryrefslogtreecommitdiff
path: root/src/macros_and_utils.h
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2024-03-22 15:36:45 +0100
committerBenoit Germain <benoit.germain@ubisoft.com>2024-03-22 15:36:45 +0100
commitbfb1277b3496018b7ee12eca2fb900ebbe651b49 (patch)
tree7909c38e5fc0c25ee0477c0b842e19adf0cd2874 /src/macros_and_utils.h
parentf0170ce8f1a90337637d387b87280f121d0578fe (diff)
downloadlanes-bfb1277b3496018b7ee12eca2fb900ebbe651b49.tar.gz
lanes-bfb1277b3496018b7ee12eca2fb900ebbe651b49.tar.bz2
lanes-bfb1277b3496018b7ee12eca2fb900ebbe651b49.zip
C++ migration: STACK_GROW is no longer a macro, sanitized and fixed warnings in keeper.cpp
Diffstat (limited to 'src/macros_and_utils.h')
-rw-r--r--src/macros_and_utils.h7
1 files changed, 6 insertions, 1 deletions
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" {
5#endif // __cplusplus 5#endif // __cplusplus
6#include "lua.h" 6#include "lua.h"
7#include "lualib.h" 7#include "lualib.h"
8#include "lauxlib.h"
8#ifdef __cplusplus 9#ifdef __cplusplus
9} 10}
10#endif // __cplusplus 11#endif // __cplusplus
@@ -78,6 +79,10 @@ extern char const* debugspew_indent;
78 79
79#define ASSERT_L(c) _ASSERT_L(L,c) 80#define ASSERT_L(c) _ASSERT_L(L,c)
80 81
81#define STACK_GROW( L, n) do { if (!lua_checkstack(L,(int)(n))) luaL_error( L, "Cannot grow stack!" ); } while( 0) 82inline void STACK_GROW(lua_State* L, int n_)
83{
84 if (!lua_checkstack(L, n_))
85 luaL_error(L, "Cannot grow stack!");
86}
82 87
83#define LUAG_FUNC( func_name) int LG_##func_name( lua_State* L) 88#define LUAG_FUNC( func_name) int LG_##func_name( lua_State* L)