From f0807fc44dde14531759306317611bab87c8fccf Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 19 Oct 2020 09:13:58 +0800 Subject: +gamelab proj --- Runtime/Scripting/luax_cfunctions.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Runtime/Scripting/luax_cfunctions.cpp (limited to 'Runtime/Scripting/luax_cfunctions.cpp') diff --git a/Runtime/Scripting/luax_cfunctions.cpp b/Runtime/Scripting/luax_cfunctions.cpp new file mode 100644 index 0000000..d93a0ee --- /dev/null +++ b/Runtime/Scripting/luax_cfunctions.cpp @@ -0,0 +1,19 @@ +#include "luax_cfunctions.h" +#include "luax_config.h" + +namespace Luax +{ + + int luax_c_getupvalue(lua_State* L) + { + lua_pushvalue(L, lua_upvalueindex(1)); + return 1; + } + + int luax_c_errfunc(lua_State* L) + { + cc8* msg = luaL_optstring(L, lua_upvalueindex(1), ""); + return luaL_error(L, msg); + } + +} \ No newline at end of file -- cgit v1.1-26-g67d0