diff options
Diffstat (limited to 'src/compat.h')
-rw-r--r-- | src/compat.h | 8 |
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 | ||
190 | inline 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 |
190 | enum class LuaError | 198 | enum class LuaError |
191 | { | 199 | { |