Revert "Build System Updated"

This commit is contained in:
Alex
2019-10-12 21:07:06 -07:00
committed by GitHub
parent 579471afcc
commit b9f57f1f28
193 changed files with 14124 additions and 10507 deletions
+34 -32
View File
@@ -26,38 +26,40 @@
#include <luabind/error.hpp>
#include <luabind/lua_include.hpp>
namespace luabind {
namespace detail {
int pcall(lua_State *L, int nargs, int nresults)
namespace luabind { namespace detail
{
int pcall(lua_State *L, int nargs, int nresults)
{
pcall_callback_fun e = get_pcall_callback();
int en = 0;
if ( e )
{
pcall_callback_fun e = get_pcall_callback();
int en = 0;
if(e)
{
int base = lua_gettop(L) - nargs;
e(L);
lua_insert(L, base); // push pcall_callback under chunk and args
en = base;
}
int result = lua_pcall(L, nargs, nresults, en);
if(en)
lua_remove(L, en); // remove pcall_callback
return result;
}
int resume_impl(lua_State *L, int nargs, int)
{
#if LUA_VERSION_NUM >= 502
int res = lua_resume(L, NULL, nargs);
#else
int res = lua_resume(L, nargs);
#endif
// Lua 5.1 added LUA_YIELD as a possible return value,
// this was causing crashes, because the caller expects 0 on success.
return (res == LUA_YIELD) ? 0 : res;
}
int base = lua_gettop(L) - nargs;
lua_pushcfunction(L, e);
lua_insert(L, base); // push pcall_callback under chunk and args
en = base;
}
int result = lua_pcall(L, nargs, nresults, en);
if ( en )
lua_remove(L, en); // remove pcall_callback
return result;
}
}
int resume_impl(lua_State *L, int nargs, int)
{
#if LUA_VERSION_NUM >= 502
int res = lua_resume(L, NULL, nargs);
#else
int res = lua_resume(L, nargs);
#endif
#if LUA_VERSION_NUM >= 501
// Lua 5.1 added LUA_YIELD as a possible return value,
// this was causing crashes, because the caller expects 0 on success.
return (res == LUA_YIELD) ? 0 : res;
#else
return res;
#endif
}
}}