Skip to content

Commit 31781a9

Browse files
committed
更新tolua#到1.0.6.289版
1 parent 62e9cd0 commit 31781a9

File tree

7 files changed

+25
-24
lines changed

7 files changed

+25
-24
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@
3131
*.dSYM/
3232
/window
3333
/Plugins
34+
/android/libs

android/jni/libluajit.a

0 Bytes
Binary file not shown.

build_ios.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ rm "$DESTDIR"/*.a
2727
cd $SRCDIR
2828

2929
make clean
30-
ISDKF="-arch armv7 -isysroot $ISDK/SDKs/$ISDKVER"
31-
make HOST_CC="gcc -m32" CROSS="$ISDKP" TARGET_FLAGS="$ISDKF" TARGET=armv7 TARGET_SYS=iOS CFLAGS="-fembed-bitcode"
30+
ISDKF="-arch armv7 -isysroot $ISDK/SDKs/$ISDKVER -miphoneos-version-min=7.0"
31+
make HOST_CC="gcc -m32" TARGET_FLAGS="$ISDKF" TARGET=armv7 TARGET_SYS=iOS
3232
mv "$SRCDIR"/src/libluajit.a "$DESTDIR"/libluajit-armv7.a
3333

3434
make clean
35-
ISDKF="-arch armv7s -isysroot $ISDK/SDKs/$ISDKVER"
36-
make HOST_CC="gcc -m32" CROSS="$ISDKP" TARGET_FLAGS="$ISDKF" TARGET=armv7s TARGET_SYS=iOS CFLAGS="-fembed-bitcode"
35+
ISDKF="-arch armv7s -isysroot $ISDK/SDKs/$ISDKVER -miphoneos-version-min=7.0"
36+
make HOST_CC="gcc -m32" TARGET_FLAGS="$ISDKF" TARGET=armv7s TARGET_SYS=iOS
3737
mv "$SRCDIR"/src/libluajit.a "$DESTDIR"/libluajit-armv7s.a
3838

3939
make clean
40-
ISDKF="-arch arm64 -isysroot $ISDK/SDKs/$ISDKVER"
41-
make HOST_CC="gcc " CROSS="$ISDKP" TARGET_FLAGS="$ISDKF" TARGET=arm64 TARGET_SYS=iOS CFLAGS="-fembed-bitcode"
40+
ISDKF="-arch arm64 -isysroot $ISDK/SDKs/$ISDKVER -miphoneos-version-min=7.0"
41+
make HOST_CC="gcc " TARGET_FLAGS="$ISDKF" TARGET=arm64 TARGET_SYS=iOS
4242
mv "$SRCDIR"/src/libluajit.a "$DESTDIR"/libluajit-arm64.a
4343
make clean
4444

int64.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -183,15 +183,15 @@ static int64_t tolua_checkint64(lua_State* L, int pos)
183183

184184
static int _int64add(lua_State* L)
185185
{
186-
int64_t lhs = *(int64_t*)lua_touserdata(L, 1);
186+
int64_t lhs = tolua_checkint64(L, 1);
187187
int64_t rhs = tolua_checkint64(L, 2);
188188
tolua_pushint64(L, lhs + rhs);
189189
return 1;
190190
}
191191

192192
static int _int64sub(lua_State* L)
193193
{
194-
int64_t lhs = *(int64_t*)lua_touserdata(L, 1);
194+
int64_t lhs = tolua_checkint64(L, 1);
195195
int64_t rhs = tolua_checkint64(L, 2);
196196
tolua_pushint64(L, lhs - rhs);
197197
return 1;
@@ -200,23 +200,23 @@ static int _int64sub(lua_State* L)
200200

201201
static int _int64mul(lua_State* L)
202202
{
203-
int64_t lhs = *(int64_t*)lua_touserdata(L, 1);
203+
int64_t lhs = tolua_checkint64(L, 1);
204204
int64_t rhs = tolua_checkint64(L, 2);
205205
tolua_pushint64(L, lhs * rhs);
206206
return 1;
207207
}
208208

209209
static int _int64div(lua_State* L)
210210
{
211-
int64_t lhs = *(int64_t*)lua_touserdata(L, 1);
211+
int64_t lhs = tolua_checkint64(L, 1);
212212
int64_t rhs = tolua_checkint64(L, 2);
213213
tolua_pushint64(L, lhs / rhs);
214214
return 1;
215215
}
216216

217217
static int _int64mod(lua_State* L)
218218
{
219-
int64_t lhs = *(int64_t*)lua_touserdata(L, 1);
219+
int64_t lhs = tolua_checkint64(L, 1);
220220
int64_t rhs = tolua_checkint64(L, 2);
221221

222222
if (rhs == 0)
@@ -237,7 +237,7 @@ static int _int64unm(lua_State* L)
237237

238238
static int _int64pow(lua_State* L)
239239
{
240-
int64_t lhs = *(int64_t*)lua_touserdata(L, 1);
240+
int64_t lhs = tolua_checkint64(L, 1);
241241
int64_t rhs = tolua_checkint64(L, 2);
242242
int64_t ret;
243243

@@ -278,15 +278,15 @@ static int _int64equals(lua_State* L)
278278

279279
static int _int64lt(lua_State* L)
280280
{
281-
int64_t lhs = *(int64_t*)lua_touserdata(L, 1);
281+
int64_t lhs = tolua_checkint64(L, 1);
282282
int64_t rhs = tolua_checkint64(L, 2);
283283
lua_pushboolean(L, lhs < rhs);
284284
return 1;
285285
}
286286

287287
static int _int64le(lua_State* L)
288288
{
289-
int64_t lhs = *(int64_t*)lua_touserdata(L, 1);
289+
int64_t lhs = tolua_checkint64(L, 1);
290290
int64_t rhs = tolua_checkint64(L, 2);
291291
lua_pushboolean(L, lhs <= rhs);
292292
return 1;

luajit-2.1/src/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ else
168168
endif
169169
# Use Clang for OSX host.
170170
ifeq (Darwin,$(HOST_SYS))
171-
DEFAULT_CC= gcc
171+
DEFAULT_CC= clang
172172
endif
173173
endif
174174

tolua.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ int tolua_newint64(lua_State* L);
5151
void tolua_openuint64(lua_State* L);
5252
int tolua_newuint64(lua_State* L);
5353

54-
int toluaflags;
54+
extern int toluaflags;
5555

5656
#endif

uint64.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -184,39 +184,39 @@ static uint64_t tolua_checkuint64(lua_State *L, int pos)
184184

185185
static int _uint64add(lua_State *L)
186186
{
187-
uint64_t lhs = *(uint64_t*)lua_touserdata(L, 1);
187+
uint64_t lhs = tolua_checkuint64(L, 1);
188188
uint64_t rhs = tolua_checkuint64(L, 2);
189189
tolua_pushuint64(L, lhs + rhs);
190190
return 1;
191191
}
192192

193193
static int _uint64sub(lua_State *L)
194194
{
195-
uint64_t lhs = *(uint64_t*)lua_touserdata(L, 1);
195+
uint64_t lhs = tolua_checkuint64(L, 1);
196196
uint64_t rhs = tolua_checkuint64(L, 2);
197197
tolua_pushuint64(L, lhs - rhs);
198198
return 1;
199199
}
200200

201201
static int _uint64mul(lua_State *L)
202202
{
203-
uint64_t lhs = *(uint64_t*)lua_touserdata(L, 1);
203+
uint64_t lhs = tolua_checkuint64(L, 1);
204204
uint64_t rhs = tolua_checkuint64(L, 2);
205205
tolua_pushuint64(L, lhs * rhs);
206206
return 1;
207207
}
208208

209209
static int _uint64div(lua_State *L)
210210
{
211-
uint64_t lhs = *(uint64_t*)lua_touserdata(L, 1);
211+
uint64_t lhs = tolua_checkuint64(L, 1);
212212
uint64_t rhs = tolua_checkuint64(L, 2);
213213
tolua_pushuint64(L, lhs / rhs);
214214
return 1;
215215
}
216216

217217
static int _uint64mod(lua_State *L)
218218
{
219-
uint64_t lhs = *(uint64_t*)lua_touserdata(L, 1);
219+
uint64_t lhs = tolua_checkuint64(L, 1);
220220
uint64_t rhs = tolua_checkuint64(L, 2);
221221

222222
if (rhs == 0)
@@ -237,7 +237,7 @@ static int _uint64unm(lua_State *L)
237237

238238
static int _uint64pow(lua_State *L)
239239
{
240-
uint64_t lhs = *(uint64_t*)lua_touserdata(L, 1);
240+
uint64_t lhs = tolua_checkuint64(L, 1);
241241
uint64_t rhs = tolua_checkuint64(L, 2);
242242
uint64_t ret;
243243

@@ -278,15 +278,15 @@ static int _uint64equals(lua_State *L)
278278

279279
static int _uint64lt(lua_State *L)
280280
{
281-
uint64_t lhs = *(uint64_t*)lua_touserdata(L, 1);
281+
uint64_t lhs = tolua_checkuint64(L, 1);
282282
uint64_t rhs = tolua_checkuint64(L, 2);
283283
lua_pushboolean(L, lhs < rhs);
284284
return 1;
285285
}
286286

287287
static int _uint64le(lua_State *L)
288288
{
289-
uint64_t lhs = *(uint64_t*)lua_touserdata(L, 1);
289+
uint64_t lhs = tolua_checkuint64(L, 1);
290290
uint64_t rhs = tolua_checkuint64(L, 2);
291291
lua_pushboolean(L, lhs <= rhs);
292292
return 1;

0 commit comments

Comments
 (0)