1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include "LuaBindCFunctions.h" #include "LuaBindConfig.h" namespace LuaBind { 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); } }