mirror of
https://github.com/CompeyDev/lei.git
synced 2025-05-04 10:43:49 +01:00
fix: luau does not export a luaL_errorL
, write our own
This commit is contained in:
parent
342c56b4da
commit
08e1de819f
2 changed files with 4 additions and 7 deletions
|
@ -13,11 +13,6 @@ lua_State* clua_newstate(void* f, void* ud)
|
||||||
return lua_newstate((lua_Alloc)f, ud);
|
return lua_newstate((lua_Alloc)f, ud);
|
||||||
}
|
}
|
||||||
|
|
||||||
l_noret cluaL_errorL(lua_State* L, char* msg)
|
|
||||||
{
|
|
||||||
luaL_errorL(L, msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
void clua_pushcclosurek(lua_State* L, void* f, char* debugname, int nup, void* cont) {
|
void clua_pushcclosurek(lua_State* L, void* f, char* debugname, int nup, void* cont) {
|
||||||
return lua_pushcclosurek(L, (lua_CFunction)f, debugname, nup, (lua_Continuation)cont);
|
return lua_pushcclosurek(L, (lua_CFunction)f, debugname, nup, (lua_Continuation)cont);
|
||||||
}
|
}
|
||||||
|
|
|
@ -171,8 +171,10 @@ func LErrorL(L *LuaState, msg string) {
|
||||||
cmsg := C.CString(msg)
|
cmsg := C.CString(msg)
|
||||||
defer C.free(unsafe.Pointer(cmsg))
|
defer C.free(unsafe.Pointer(cmsg))
|
||||||
|
|
||||||
C.cluaL_errorL(L, cmsg)
|
PushString(L, msg)
|
||||||
panic(msg)
|
Error(L)
|
||||||
|
|
||||||
|
// TODO: do we panic on the go side?
|
||||||
}
|
}
|
||||||
|
|
||||||
func LCheckOption(L *LuaState, narg int32, def string, lst []string) int32 {
|
func LCheckOption(L *LuaState, narg int32, def string, lst []string) int32 {
|
||||||
|
|
Loading…
Add table
Reference in a new issue