|
1 | 1 | --- lua/lopcodes.h |
2 | 2 | +++ 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) |
6 | 6 |
|
7 | 7 | - |
8 | 8 | -#if L_INTHASBITS(SIZE_Bx) |
9 | 9 | +#if defined(_M_I86) |
10 | | -+#define MAXARG_Bx MAX_INT |
| 10 | ++#define MAXARG_Bx INT_MAX |
11 | 11 | +#elif L_INTHASBITS(SIZE_Bx) |
12 | 12 | #define MAXARG_Bx ((1<<SIZE_Bx)-1) |
13 | 13 | #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}; |
17 | 16 | #define OFFSET_sBx (MAXARG_Bx>>1) /* 'sBx' is signed */ |
18 | 17 |
|
19 | | -- |
| 18 | + |
20 | 19 | -#if L_INTHASBITS(SIZE_Ax) |
21 | 20 | +#if defined(_M_I86) |
22 | | -+#define MAXARG_Ax MAX_INT |
| 21 | ++#define MAXARG_Ax INT_MAX |
23 | 22 | +#elif L_INTHASBITS(SIZE_Ax) |
24 | 23 | #define MAXARG_Ax ((1<<SIZE_Ax)-1) |
25 | 24 | #else |
26 | | - #define MAXARG_Ax MAX_INT |
| 25 | + #define MAXARG_Ax INT_MAX |
27 | 26 | #endif |
28 | 27 |
|
29 | 28 | -#if L_INTHASBITS(SIZE_sJ) |
30 | 29 | +#if defined(_M_I86) |
31 | | -+#define MAXARG_sJ MAX_INT |
| 30 | ++#define MAXARG_sJ INT_MAX |
32 | 31 | +#elif L_INTHASBITS(SIZE_sJ) |
33 | 32 | #define MAXARG_sJ ((1 << SIZE_sJ) - 1) |
34 | 33 | #else |
35 | | - #define MAXARG_sJ MAX_INT |
| 34 | + #define MAXARG_sJ INT_MAX |
36 | 35 | --- lua/luaconf.h |
37 | 36 | +++ lua/luaconf.h |
38 | | -@@ -79,7 +79,12 @@ |
| 37 | +@@ -95,7 +95,12 @@ |
39 | 38 | /* |
40 | 39 | @@ LUAI_IS32INT is true iff 'int' has (at least) 32 bits. |
41 | 40 | */ |
|
48 | 47 |
|
49 | 48 | /* }================================================================== */ |
50 | 49 |
|
51 | | -@@ -221,17 +226,43 @@ |
| 50 | +@@ -237,17 +242,43 @@ |
52 | 51 | LUA_CDIR"loadall.dll;" ".\\?.dll" |
53 | 52 | #endif |
54 | 53 |
|
|
93 | 92 | #endif |
94 | 93 |
|
95 | 94 | #if !defined(LUA_CPATH_DEFAULT) |
96 | | -@@ -249,7 +280,7 @@ |
| 95 | +@@ -265,7 +296,7 @@ |
97 | 96 | */ |
98 | 97 | #if !defined(LUA_DIRSEP) |
99 | 98 |
|
|
102 | 101 | #define LUA_DIRSEP "\\" |
103 | 102 | #else |
104 | 103 | #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