diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-05-13 14:24:10 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-05-13 14:24:10 -0300 |
| commit | 49c42f3615bd876657bf697e3bf040ce796ae238 (patch) | |
| tree | bb2268fbcd525045b5e9ed523b5dab8a67fc7fe1 /llimits.h | |
| parent | d881325c2fcbb6d2c434ec403b0bbe51ac200c7b (diff) | |
| download | lua-49c42f3615bd876657bf697e3bf040ce796ae238.tar.gz lua-49c42f3615bd876657bf697e3bf040ce796ae238.tar.bz2 lua-49c42f3615bd876657bf697e3bf040ce796ae238.zip | |
Some improvements in 'luaconf.h'
Added '#if !defined' in some definitions to allow external definitions;
more comments; other small changes.
Diffstat (limited to 'llimits.h')
| -rw-r--r-- | llimits.h | 11 |
1 files changed, 7 insertions, 4 deletions
| @@ -14,6 +14,11 @@ | |||
| 14 | 14 | ||
| 15 | #include "lua.h" | 15 | #include "lua.h" |
| 16 | 16 | ||
| 17 | |||
| 18 | /* minimum number of bits in an integer */ | ||
| 19 | #define LUAI_BITSINT (LUAI_IS32INT ? 32 : 16) | ||
| 20 | |||
| 21 | |||
| 17 | /* | 22 | /* |
| 18 | ** 'lu_mem' and 'l_mem' are unsigned/signed integers big enough to count | 23 | ** 'lu_mem' and 'l_mem' are unsigned/signed integers big enough to count |
| 19 | ** the total memory used by Lua (in bytes). Usually, 'size_t' and | 24 | ** the total memory used by Lua (in bytes). Usually, 'size_t' and |
| @@ -22,7 +27,7 @@ | |||
| 22 | #if defined(LUAI_MEM) /* { external definitions? */ | 27 | #if defined(LUAI_MEM) /* { external definitions? */ |
| 23 | typedef LUAI_UMEM lu_mem; | 28 | typedef LUAI_UMEM lu_mem; |
| 24 | typedef LUAI_MEM l_mem; | 29 | typedef LUAI_MEM l_mem; |
| 25 | #elif LUAI_BITSINT >= 32 /* }{ */ | 30 | #elif LUAI_IS32INT /* }{ */ |
| 26 | typedef size_t lu_mem; | 31 | typedef size_t lu_mem; |
| 27 | typedef ptrdiff_t l_mem; | 32 | typedef ptrdiff_t l_mem; |
| 28 | #else /* 16-bit ints */ /* }{ */ | 33 | #else /* 16-bit ints */ /* }{ */ |
| @@ -172,13 +177,11 @@ typedef LUAI_UACINT l_uacInt; | |||
| 172 | #endif | 177 | #endif |
| 173 | 178 | ||
| 174 | 179 | ||
| 175 | |||
| 176 | |||
| 177 | /* | 180 | /* |
| 178 | ** type for virtual-machine instructions; | 181 | ** type for virtual-machine instructions; |
| 179 | ** must be an unsigned with (at least) 4 bytes (see details in lopcodes.h) | 182 | ** must be an unsigned with (at least) 4 bytes (see details in lopcodes.h) |
| 180 | */ | 183 | */ |
| 181 | #if LUAI_BITSINT >= 32 | 184 | #if LUAI_IS32INT |
| 182 | typedef unsigned int l_uint32; | 185 | typedef unsigned int l_uint32; |
| 183 | #else | 186 | #else |
| 184 | typedef unsigned long l_uint32; | 187 | typedef unsigned long l_uint32; |
