From 03428d9825cfdf2cfaed6ac9410dafccac0d4f3a Mon Sep 17 00:00:00 2001 From: Jude Melton-Houghton Date: Mon, 26 Sep 2022 07:23:48 -0400 Subject: Modify PUC Lua to wrap C++ exceptions (#12445) --- lib/lua/src/lapi.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/lua/src/lapi.c') diff --git a/lib/lua/src/lapi.c b/lib/lua/src/lapi.c index 5d5145d2e..383e65d60 100644 --- a/lib/lua/src/lapi.c +++ b/lib/lua/src/lapi.c @@ -137,6 +137,18 @@ LUA_API lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf) { } +/* MINETEST-SPECIFIC CHANGE */ +LUA_API lua_CFunctionwrapper lua_atccall (lua_State *L, + lua_CFunctionwrapper wrapf) { + lua_CFunctionwrapper old; + lua_lock(L); + old = G(L)->wrapcf; + G(L)->wrapcf = wrapf; + lua_unlock(L); + return old; +} + + LUA_API lua_State *lua_newthread (lua_State *L) { lua_State *L1; lua_lock(L); -- cgit v1.2.3