From 49c42f3615bd876657bf697e3bf040ce796ae238 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 13 May 2019 14:24:10 -0300 Subject: Some improvements in 'luaconf.h' Added '#if !defined' in some definitions to allow external definitions; more comments; other small changes. --- llimits.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'llimits.h') diff --git a/llimits.h b/llimits.h index febf7555..950e7e64 100644 --- a/llimits.h +++ b/llimits.h @@ -14,6 +14,11 @@ #include "lua.h" + +/* minimum number of bits in an integer */ +#define LUAI_BITSINT (LUAI_IS32INT ? 32 : 16) + + /* ** 'lu_mem' and 'l_mem' are unsigned/signed integers big enough to count ** the total memory used by Lua (in bytes). Usually, 'size_t' and @@ -22,7 +27,7 @@ #if defined(LUAI_MEM) /* { external definitions? */ typedef LUAI_UMEM lu_mem; typedef LUAI_MEM l_mem; -#elif LUAI_BITSINT >= 32 /* }{ */ +#elif LUAI_IS32INT /* }{ */ typedef size_t lu_mem; typedef ptrdiff_t l_mem; #else /* 16-bit ints */ /* }{ */ @@ -172,13 +177,11 @@ typedef LUAI_UACINT l_uacInt; #endif - - /* ** type for virtual-machine instructions; ** must be an unsigned with (at least) 4 bytes (see details in lopcodes.h) */ -#if LUAI_BITSINT >= 32 +#if LUAI_IS32INT typedef unsigned int l_uint32; #else typedef unsigned long l_uint32; -- cgit v1.2.3-55-g6feb