old_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $LUA_CFLAGS $LUA_LIBS"
+ AC_CHECK_FUNCS([luaL_setfuncs])
+ AC_CHECK_FUNCS([luaL_setmetatable])
AC_CHECK_FUNCS([lua_isinteger])
AC_CHECK_FUNCS([lua_tointegerx])
#include "strnum.h"
#include "dlua-script-private.h"
-#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
+#ifndef HAVE_LUAL_SETFUNCS
void luaL_setfuncs(lua_State *L, const luaL_Reg *l, int nup)
{
luaL_checkstack(L, nup + 1, "too many upvalues");
}
lua_pop(L, nup);
}
+#endif
+#ifndef HAVE_LUAL_SETMETATABLE
void luaL_setmetatable(lua_State *L, const char *tname)
{
luaL_checkstack(L, 1, "not enough stack slots");
# define lua_load(L, r, s, fn, m) lua_load(L, r, s, fn)
# define luaL_newlibtable(L, l) (lua_createtable(L, 0, sizeof(l)/sizeof(*(l))-1))
# define luaL_newlib(L, l) (luaL_newlibtable(L, l), luaL_register(L, NULL, l))
+#endif
+
+#ifndef HAVE_LUAL_SETFUNCS
void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup);
+#endif
+
+#ifndef HAVE_LUAL_SETMETATABLE
void luaL_setmetatable (lua_State *L, const char *tname);
#endif