aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2024-12-16 14:27:58 +0100
committerMike Pall <mike>2024-12-16 14:27:58 +0100
commitcd8d0a437ddf4631a990f773fc3f0a6b991cfb8c (patch)
tree28d4e391114ae49ff8ef7fa55e3fb7f568e14761
parent19878ec05c239ccaf5f3d17af27670a963e25b8b (diff)
downloadluajit-cd8d0a437ddf4631a990f773fc3f0a6b991cfb8c.tar.gz
luajit-cd8d0a437ddf4631a990f773fc3f0a6b991cfb8c.tar.bz2
luajit-cd8d0a437ddf4631a990f773fc3f0a6b991cfb8c.zip
Remove dependency on <limits.h>.
Reported by yupengda002. #1318
-rw-r--r--src/lj_tab.c2
-rw-r--r--src/luaconf.h1
2 files changed, 1 insertions, 2 deletions
diff --git a/src/lj_tab.c b/src/lj_tab.c
index 535a69f5..869c5f03 100644
--- a/src/lj_tab.c
+++ b/src/lj_tab.c
@@ -635,7 +635,7 @@ LJ_NOINLINE static MSize tab_len_slow(GCtab *t, size_t hi)
635 while ((tv = lj_tab_getint(t, (int32_t)hi)) && !tvisnil(tv)) { 635 while ((tv = lj_tab_getint(t, (int32_t)hi)) && !tvisnil(tv)) {
636 lo = hi; 636 lo = hi;
637 hi += hi; 637 hi += hi;
638 if (hi > (size_t)(INT_MAX-2)) { /* Punt and do a linear search. */ 638 if (hi > (size_t)(0x7fffffff - 2)) { /* Punt and do a linear search. */
639 lo = 1; 639 lo = 1;
640 while ((tv = lj_tab_getint(t, (int32_t)lo)) && !tvisnil(tv)) lo++; 640 while ((tv = lj_tab_getint(t, (int32_t)lo)) && !tvisnil(tv)) lo++;
641 return (MSize)(lo - 1); 641 return (MSize)(lo - 1);
diff --git a/src/luaconf.h b/src/luaconf.h
index 1cf3a03c..7b15651c 100644
--- a/src/luaconf.h
+++ b/src/luaconf.h
@@ -9,7 +9,6 @@
9#ifndef WINVER 9#ifndef WINVER
10#define WINVER 0x0501 10#define WINVER 0x0501
11#endif 11#endif
12#include <limits.h>
13#include <stddef.h> 12#include <stddef.h>
14 13
15/* Default path for loading Lua and C modules with require(). */ 14/* Default path for loading Lua and C modules with require(). */