Swapped luabind for non-boost fork

https://github.com/decimad/luabind-deboostified
This commit is contained in:
Adam Martin
2019-02-02 00:06:32 -06:00
parent cbe811cf94
commit 26eb4fb6e0
123 changed files with 9408 additions and 10110 deletions
+27 -29
View File
@@ -26,40 +26,38 @@
#include <luabind/error.hpp>
#include <luabind/lua_include.hpp>
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 )
namespace luabind {
namespace detail {
int pcall(lua_State *L, int nargs, int nresults)
{
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;
}
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)
{
int resume_impl(lua_State *L, int nargs, int)
{
#if LUA_VERSION_NUM >= 502
int res = lua_resume(L, NULL, nargs);
int res = lua_resume(L, NULL, nargs);
#else
int res = lua_resume(L, nargs);
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;
}
#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
}
}
}}