You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In fact, it's simple enough to just be included here. I found this in a commit of some other Lua project which had the same issue.
diff --git a/rng.c b/rng.c
index 8c3c857..c2b37fe 100644
--- a/rng.c+++ b/rng.c@@ -44,6 +44,18 @@ static int rng__tostring (lua_State *L) {
* Core
* ======================================================================} */
++#if LUA_VERSION_NUM >= 503+/* one can simply enable LUA_COMPAT_5_2 to be backward compatible.+However, this does not work when we are trying to use system-installed lua,+hence these redefines+*/+#define luaL_optlong(L,n,d) ((long)luaL_optinteger(L, (n), (d)))+#define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d)))+#define luaL_checklong(L,n) ((long)luaL_checkinteger(L, (n)))+#define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n)))+#endif+
static int new_rng (lua_State *L) {
init_genrand(newrng(L), luaL_optlong(L, 1, RNG_SEED));
return 1;
Reacted by Rijnder Wever, Bach Phan and Federico Zarelli
Activity
agraef commentedon Nov 1, 2017
In fact, it's simple enough to just be included here. I found this in a commit of some other Lua project which had the same issue.
Add some lua 5.3 compat macros