From: nhkeni Date: Wed, 18 May 2022 18:11:00 +0000 (-0400) Subject: 5.3.5 is not currently compatible with NHL_SANDBOX, but make it compile X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a6c3d8de50985cffb140b25b4dad2bb66f723a8;p=nethack 5.3.5 is not currently compatible with NHL_SANDBOX, but make it compile with 5.3.5 and !NHL_SANDBOX --- diff --git a/src/nhlua.c b/src/nhlua.c index effe0c3a9..0045b4348 100644 --- a/src/nhlua.c +++ b/src/nhlua.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 nhlua.c $NHDT-Date: 1652894653 2022/05/18 17:24:13 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.77 $ */ +/* NetHack 3.7 nhlua.c $NHDT-Date: 1652897460 2022/05/18 18:11:00 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.78 $ */ /* Copyright (c) 2018 by Pasi Kallinen */ /* NetHack may be freely redistributed. See license for details. */ @@ -2298,11 +2298,16 @@ nhlL_newstate (nhl_sandbox_info *sbi) { } lua_State *L = lua_newstate(nhl_alloc, nud); +#if LUA_VERSION_NUM == 503 +# define luai_likely(x) (x) +#endif if (luai_likely(L)) { lua_atpanic(L, &nhl_panic); +#if LUA_VERSION_NUM == 504 /* no warning system at the moment - it requires concatenting * strings to fit NetHack's API XXX */ lua_setwarnf(L, 0, L); /* default is warnings off */ +#endif } #ifdef NHL_SANDBOX