From 347d6961ac14213264c7176e3d125c9ba8475b01 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 14 May 2019 11:10:24 -0300 Subject: Define LUA_MAXUNSIGNED as a preprocessor constant The previous definition of LUA_MAXUNSIGNED used a typecast, making it unsuitable for constant expressions in the preprocessor. --- lmathlib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lmathlib.c') diff --git a/lmathlib.c b/lmathlib.c index 3454c41f..f6f0b426 100644 --- a/lmathlib.c +++ b/lmathlib.c @@ -276,7 +276,7 @@ static int math_type (lua_State *L) { /* there is a 'long long' type (which must have at least 64 bits) */ #define Rand64 unsigned long long -#elif (LUA_MAXINTEGER >> 30 >> 30) >= 7 +#elif (LUA_MAXUNSIGNED >> 31 >> 31) >= 3 /* 'lua_Integer' has at least 64 bits */ #define Rand64 lua_Unsigned @@ -538,7 +538,7 @@ static lua_Unsigned project (lua_Unsigned ran, lua_Unsigned n, lim |= (lim >> 4); lim |= (lim >> 8); lim |= (lim >> 16); -#if (LUA_MAXINTEGER >> 30) >= 3 +#if (LUA_MAXUNSIGNED >> 31) >= 3 lim |= (lim >> 32); /* integer type has more than 32 bits */ #endif } -- cgit v1.2.3-55-g6feb