Skip to content

Commit 8f6a193

Browse files
committed
Updated patch for Lua repository.
1 parent a868095 commit 8f6a193

File tree

1 file changed

+14
-28
lines changed

1 file changed

+14
-28
lines changed

lua.pat

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,40 @@
11
--- lua/lopcodes.h
22
+++ lua/lopcodes.h
3-
@@ -67,8 +67,9 @@ enum OpMode {iABC, iABx, iAsBx, iAx, isJ}; /* basic instruction formats */
4-
/* Check whether type 'int' has at least 'b' bits ('b' < 32) */
5-
#define L_INTHASBITS(b) ((UINT_MAX >> ((b) - 1)) >= 1)
3+
@@ -78,8 +78,9 @@ enum OpMode {iABC, ivABC, iABx, iAsBx, iAx, isJ};
4+
*/
5+
#define L_INTHASBITS(b) ((UINT_MAX >> (b)) >= 1)
66

77
-
88
-#if L_INTHASBITS(SIZE_Bx)
99
+#if defined(_M_I86)
10-
+#define MAXARG_Bx MAX_INT
10+
+#define MAXARG_Bx INT_MAX
1111
+#elif L_INTHASBITS(SIZE_Bx)
1212
#define MAXARG_Bx ((1<<SIZE_Bx)-1)
1313
#else
14-
#define MAXARG_Bx MAX_INT
15-
@@ -76,14 +77,17 @@ enum OpMode {iABC, iABx, iAsBx, iAx, isJ}; /* basic instruction formats */
16-
14+
#define MAXARG_Bx INT_MAX
15+
@@ -88,13 +89,17 @@ enum OpMode {iABC, ivABC, iABx, iAsBx, iAx, isJ};
1716
#define OFFSET_sBx (MAXARG_Bx>>1) /* 'sBx' is signed */
1817

19-
-
18+
2019
-#if L_INTHASBITS(SIZE_Ax)
2120
+#if defined(_M_I86)
22-
+#define MAXARG_Ax MAX_INT
21+
+#define MAXARG_Ax INT_MAX
2322
+#elif L_INTHASBITS(SIZE_Ax)
2423
#define MAXARG_Ax ((1<<SIZE_Ax)-1)
2524
#else
26-
#define MAXARG_Ax MAX_INT
25+
#define MAXARG_Ax INT_MAX
2726
#endif
2827

2928
-#if L_INTHASBITS(SIZE_sJ)
3029
+#if defined(_M_I86)
31-
+#define MAXARG_sJ MAX_INT
30+
+#define MAXARG_sJ INT_MAX
3231
+#elif L_INTHASBITS(SIZE_sJ)
3332
#define MAXARG_sJ ((1 << SIZE_sJ) - 1)
3433
#else
35-
#define MAXARG_sJ MAX_INT
34+
#define MAXARG_sJ INT_MAX
3635
--- lua/luaconf.h
3736
+++ lua/luaconf.h
38-
@@ -79,7 +79,12 @@
37+
@@ -95,7 +95,12 @@
3938
/*
4039
@@ LUAI_IS32INT is true iff 'int' has (at least) 32 bits.
4140
*/
@@ -48,7 +47,7 @@
4847

4948
/* }================================================================== */
5049

51-
@@ -221,17 +226,43 @@
50+
@@ -237,17 +242,43 @@
5251
LUA_CDIR"loadall.dll;" ".\\?.dll"
5352
#endif
5453

@@ -93,7 +92,7 @@
9392
#endif
9493

9594
#if !defined(LUA_CPATH_DEFAULT)
96-
@@ -249,7 +280,7 @@
95+
@@ -265,7 +296,7 @@
9796
*/
9897
#if !defined(LUA_DIRSEP)
9998

@@ -102,16 +101,3 @@
102101
#define LUA_DIRSEP "\\"
103102
#else
104103
#define LUA_DIRSEP "/"
105-
--- lua/lutf8lib.c
106-
+++ lua/lutf8lib.c
107-
@@ -31,7 +31,9 @@
108-
/*
109-
** Integer type for decoded UTF-8 values; MAXUTF needs 31 bits.
110-
*/
111-
-#if (UINT_MAX >> 30) >= 1
112-
+#if defined(_M_I86)
113-
+typedef unsigned long utfint;
114-
+#elif (UINT_MAX >> 30) >= 1
115-
typedef unsigned int utfint;
116-
#else
117-
typedef unsigned long utfint;

0 commit comments

Comments
 (0)