Remove dependency on <limits.h>.

Reported by yupengda002. #1318
This commit is contained in:
Mike Pall 2024-12-16 14:27:58 +01:00
parent 19878ec05c
commit cd8d0a437d
2 changed files with 1 additions and 2 deletions

View File

@ -635,7 +635,7 @@ LJ_NOINLINE static MSize tab_len_slow(GCtab *t, size_t hi)
while ((tv = lj_tab_getint(t, (int32_t)hi)) && !tvisnil(tv)) { while ((tv = lj_tab_getint(t, (int32_t)hi)) && !tvisnil(tv)) {
lo = hi; lo = hi;
hi += hi; hi += hi;
if (hi > (size_t)(INT_MAX-2)) { /* Punt and do a linear search. */ if (hi > (size_t)(0x7fffffff - 2)) { /* Punt and do a linear search. */
lo = 1; lo = 1;
while ((tv = lj_tab_getint(t, (int32_t)lo)) && !tvisnil(tv)) lo++; while ((tv = lj_tab_getint(t, (int32_t)lo)) && !tvisnil(tv)) lo++;
return (MSize)(lo - 1); return (MSize)(lo - 1);

View File

@ -9,7 +9,6 @@
#ifndef WINVER #ifndef WINVER
#define WINVER 0x0501 #define WINVER 0x0501
#endif #endif
#include <limits.h>
#include <stddef.h> #include <stddef.h>
/* Default path for loading Lua and C modules with require(). */ /* Default path for loading Lua and C modules with require(). */