aboutsummaryrefslogtreecommitdiff
path: root/src/compat.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/compat.h')
-rw-r--r--src/compat.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compat.h b/src/compat.h
index 7ac864e..ceb1275 100644
--- a/src/compat.h
+++ b/src/compat.h
@@ -186,6 +186,14 @@ inline int luaL_optint(lua_State* L_, int n_, lua_Integer d_)
186 186
187// ################################################################################################# 187// #################################################################################################
188 188
189// use this in place of lua_absindex to save a function call
190inline int luaG_absindex(lua_State* L_, int idx_)
191{
192 return (((idx_) >= 0 || (idx_) <= LUA_REGISTRYINDEX) ? (idx_) : lua_gettop(L_) + (idx_) + 1);
193}
194
195// #################################################################################################
196
189// a strong-typed wrapper over lua error codes to see them easier in a debugger 197// a strong-typed wrapper over lua error codes to see them easier in a debugger
190enum class LuaError 198enum class LuaError
191{ 199{