AC_CHECK_FUNCS([luaL_setmetatable])
AC_CHECK_FUNCS([lua_isinteger])
AC_CHECK_FUNCS([lua_resume])
+ AC_CHECK_FUNCS([lua_seti])
AC_CHECK_FUNCS([lua_tointegerx])
AC_CHECK_FUNCS([lua_yieldk])
}
#endif
+#ifndef HAVE_LUA_SETI
+void lua_seti(lua_State *L, int index, lua_Integer n)
+{
+ /* stack: value (top) */
+ lua_pushinteger(L, n);
+ /* stack: value, n (top) */
+ lua_insert(L, -2);
+ /* stack: n, value (top) */
+
+ /* adjust relative stack position */
+ if (index < 0)
+ index--;
+
+ lua_settable(L, index);
+}
+#endif
+
#ifndef HAVE_LUA_TOINTEGERX
# if LUA_VERSION_NUM >= 502
# error "Lua 5.2+ should have lua_tointegerx()"
int lua_isinteger(lua_State *L, int idx);
#endif
+#ifndef HAVE_LUA_SETI
+void lua_seti(lua_State *L, int index, lua_Integer n);
+#endif
+
#ifndef HAVE_LUA_TOINTEGERX
/*
* Lua 5.2 and 5.3 both have lua_tointegerx(), but their behavior is subtly