aboutsummaryrefslogtreecommitdiff
path: root/src/macros_and_utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/macros_and_utils.h')
-rw-r--r--src/macros_and_utils.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/macros_and_utils.h b/src/macros_and_utils.h
index c549d72..370cbed 100644
--- a/src/macros_and_utils.h
+++ b/src/macros_and_utils.h
@@ -124,3 +124,10 @@ inline void STACK_GROW(lua_State* L, int n_)
124} 124}
125 125
126#define LUAG_FUNC( func_name) int LG_##func_name( lua_State* L) 126#define LUAG_FUNC( func_name) int LG_##func_name( lua_State* L)
127
128// a small helper to extract a userdata pointer from the stack
129template<typename T>
130T* lua_touserdata(lua_State* L, int index_)
131{
132 return static_cast<T*>(lua_touserdata(L, index_));
133}