Luabind updated to be able to be compiled with Lua 5.2. Didn't really test it with 5.2 though since I'm still on 5.1. In theory it should work now though.

This commit is contained in:
KimLS
2013-12-28 18:19:12 -08:00
parent 864338a881
commit b727cbbfe9
10 changed files with 84 additions and 33 deletions
+6 -11
View File
@@ -146,11 +146,10 @@ int luabind::detail::class_rep::constructor_dispatcher(lua_State* L)
&& cls->get_class_type() == class_rep::lua_class
&& !cls->bases().empty())
{
lua_pushstring(L, "super");
lua_pushvalue(L, 1);
lua_pushvalue(L, -3);
lua_pushvalue(L, -2);
lua_pushcclosure(L, super_callback, 2);
lua_settable(L, LUA_GLOBALSINDEX);
lua_setglobal(L, "super");
}
lua_pushvalue(L, -1);
@@ -169,9 +168,8 @@ int luabind::detail::class_rep::constructor_dispatcher(lua_State* L)
if (super_deprecation_disabled)
{
lua_pushstring(L, "super");
lua_pushnil(L);
lua_settable(L, LUA_GLOBALSINDEX);
lua_setglobal(L, "super");
}
return 1;
@@ -214,17 +212,15 @@ int luabind::detail::class_rep::super_callback(lua_State* L)
if (base->bases().empty())
{
lua_pushstring(L, "super");
lua_pushnil(L);
lua_settable(L, LUA_GLOBALSINDEX);
lua_setglobal(L, "super");
}
else
{
lua_pushstring(L, "super");
lua_pushlightuserdata(L, base);
lua_pushvalue(L, lua_upvalueindex(2));
lua_pushcclosure(L, super_callback, 2);
lua_settable(L, LUA_GLOBALSINDEX);
lua_setglobal(L, "super");
}
base->get_table(L);
@@ -241,9 +237,8 @@ int luabind::detail::class_rep::super_callback(lua_State* L)
// TODO: instead of clearing the global variable "super"
// store it temporarily in the registry. maybe we should
// have some kind of warning if the super global is used?
lua_pushstring(L, "super");
lua_pushnil(L);
lua_settable(L, LUA_GLOBALSINDEX);
lua_setglobal(L, "super");
return 0;
}