diff --git a/apps/twnlua/game.c b/apps/twnlua/game.c index a76e5de..10b16aa 100644 --- a/apps/twnlua/game.c +++ b/apps/twnlua/game.c @@ -152,7 +152,7 @@ void game_tick(void) { State *state = ctx.udata; /* let's init lua */ - lua_State *new_state = luaL_newstate(custom_alloc); + lua_State *new_state = lua_newstate(custom_alloc, NULL); lua_setallocf(new_state, custom_alloc, NULL); /* state existed already, copy its udata over */ diff --git a/apps/twnlua/minilua.h b/apps/twnlua/minilua.h index e201324..53d6550 100644 --- a/apps/twnlua/minilua.h +++ b/apps/twnlua/minilua.h @@ -1513,7 +1513,7 @@ LUALIB_API int (luaL_loadbufferx) (lua_State *L, const char *buff, size_t sz, const char *name, const char *mode); LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s); -LUALIB_API lua_State *(luaL_newstate) (lua_Alloc alloc); +LUALIB_API lua_State *(luaL_newstate) (void); LUALIB_API lua_Integer (luaL_len) (lua_State *L, int idx); @@ -21898,8 +21898,8 @@ static void warnfon (void *ud, const char *message, int tocont) { } -LUALIB_API lua_State *luaL_newstate (lua_Alloc alloc) { - lua_State *L = lua_newstate(alloc ? alloc : l_alloc, NULL); +LUALIB_API lua_State *luaL_newstate (void) { + lua_State *L = lua_newstate(l_alloc, NULL); if (l_likely(L)) { lua_atpanic(L, &panic); lua_setwarnf(L, warnfoff, L); /* default is warnings off */