add lua_isyieldable() from 5.3

This commit is contained in:
Francois Perrad 2017-03-24 10:53:03 +01:00
parent 17d1bb9aec
commit bee331e23d
2 changed files with 8 additions and 0 deletions

View File

@ -1110,6 +1110,11 @@ LUALIB_API int luaL_callmeta(lua_State *L, int idx, const char *field)
/* -- Coroutine yield and resume ------------------------------------------ */
LUA_API int lua_isyieldable(lua_State *L)
{
return cframe_canyield(L->cframe);
}
LUA_API int lua_yield(lua_State *L, int nresults)
{
void *cf = L->cframe;

View File

@ -351,6 +351,9 @@ LUA_API int lua_loadx (lua_State *L, lua_Reader reader, void *dt,
LUA_API const lua_Number *lua_version (lua_State *L);
LUA_API void lua_copy (lua_State *L, int fromidx, int toidx);
/* From Lua 5.3. */
LUA_API int lua_isyieldable (lua_State *L);
struct lua_Debug {
int event;