Skip to content

Commit 2874da3

Browse files
authored
sync v3 build changes into metal-support (#344)
* [lua] use luajit (#335) * [win32] compile libwebsockets in release mode (#334) * revert windows lib (#336) * [luajit] upgrade to 2.1.0-beta3 & fix cmakelists.txt deps (#337) * [vs2017] recompiler box2d and chipmunk to support vs2017 (#338) * Remove CC_TARGET_PLATFORM marco (#340) * already support 64 bits offset by define _FILE_OFFSET_BITS=64 (#341) * fix file api macro (#343) * remove USE_FILE32API macro * add defination * update * Update version.json
1 parent a8b163e commit 2874da3

25 files changed

Lines changed: 48 additions & 59 deletions

File tree

-378 KB
Binary file not shown.
-10.3 MB
Binary file not shown.

CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,11 @@ if(BUILD_JS_LIBS)
5656
)
5757
endif()
5858
if(BUILD_LUA_LIBS)
59-
add_subdirectory(lua/lua)
6059
add_subdirectory(lua/luajit)
6160
add_subdirectory(lua/tolua)
6261
add_subdirectory(lua/luasocket)
6362
set_property(TARGET external APPEND PROPERTY
64-
CC_LUA_DEPEND ext_lua ext_luajit ext_tolua ext_luasocket
63+
CC_LUA_DEPEND ext_luajit ext_tolua ext_luasocket
6564
)
6665
endif()
6766

-1.06 MB
Binary file not shown.
-1.07 MB
Binary file not shown.
-1.17 MB
Binary file not shown.
-1.55 MB
Binary file not shown.
-2.2 MB
Binary file not shown.

lua/luajit/include/lauxlib.h

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
#include "lua.h"
1616

1717

18-
#define luaL_getn(L,i) ((int)lua_objlen(L, i))
19-
#define luaL_setn(L,i,j) ((void)0) /* no op! */
20-
2118
/* extra error code for `luaL_load' */
2219
#define LUA_ERRFILE (LUA_ERRERR+1)
2320

@@ -58,6 +55,10 @@ LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...);
5855
LUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def,
5956
const char *const lst[]);
6057

58+
/* pre-defined references */
59+
#define LUA_NOREF (-2)
60+
#define LUA_REFNIL (-1)
61+
6162
LUALIB_API int (luaL_ref) (lua_State *L, int t);
6263
LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref);
6364

@@ -84,6 +85,11 @@ LUALIB_API int (luaL_loadbufferx) (lua_State *L, const char *buff, size_t sz,
8485
const char *name, const char *mode);
8586
LUALIB_API void luaL_traceback (lua_State *L, lua_State *L1, const char *msg,
8687
int level);
88+
LUALIB_API void (luaL_setfuncs) (lua_State *L, const luaL_Reg *l, int nup);
89+
LUALIB_API void (luaL_pushmodule) (lua_State *L, const char *modname,
90+
int sizehint);
91+
LUALIB_API void *(luaL_testudata) (lua_State *L, int ud, const char *tname);
92+
LUALIB_API void (luaL_setmetatable) (lua_State *L, const char *tname);
8793

8894

8995
/*
@@ -113,6 +119,11 @@ LUALIB_API void luaL_traceback (lua_State *L, lua_State *L1, const char *msg,
113119

114120
#define luaL_opt(L,f,n,d) (lua_isnoneornil(L,(n)) ? (d) : f(L,(n)))
115121

122+
/* From Lua 5.2. */
123+
#define luaL_newlibtable(L, l) \
124+
lua_createtable(L, 0, sizeof(l)/sizeof((l)[0]) - 1)
125+
#define luaL_newlib(L, l) (luaL_newlibtable(L, l), luaL_setfuncs(L, l, 0))
126+
116127
/*
117128
** {======================================================
118129
** Generic Buffer manipulation
@@ -147,21 +158,4 @@ LUALIB_API void (luaL_pushresult) (luaL_Buffer *B);
147158

148159
/* }====================================================== */
149160

150-
151-
/* compatibility with ref system */
152-
153-
/* pre-defined references */
154-
#define LUA_NOREF (-2)
155-
#define LUA_REFNIL (-1)
156-
157-
#define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \
158-
(lua_pushstring(L, "unlocked references are obsolete"), lua_error(L), 0))
159-
160-
#define lua_unref(L,ref) luaL_unref(L, LUA_REGISTRYINDEX, (ref))
161-
162-
#define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, (ref))
163-
164-
165-
#define luaL_reg luaL_Reg
166-
167161
#endif

lua/luajit/include/lua.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
#define lua_upvalueindex(i) (LUA_GLOBALSINDEX-(i))
4040

4141

42-
/* thread status; 0 is OK */
42+
/* thread status */
43+
#define LUA_OK 0
4344
#define LUA_YIELD 1
4445
#define LUA_ERRRUN 2
4546
#define LUA_ERRSYNTAX 3
@@ -347,6 +348,13 @@ LUA_API void *lua_upvalueid (lua_State *L, int idx, int n);
347348
LUA_API void lua_upvaluejoin (lua_State *L, int idx1, int n1, int idx2, int n2);
348349
LUA_API int lua_loadx (lua_State *L, lua_Reader reader, void *dt,
349350
const char *chunkname, const char *mode);
351+
LUA_API const lua_Number *lua_version (lua_State *L);
352+
LUA_API void lua_copy (lua_State *L, int fromidx, int toidx);
353+
LUA_API lua_Number lua_tonumberx (lua_State *L, int idx, int *isnum);
354+
LUA_API lua_Integer lua_tointegerx (lua_State *L, int idx, int *isnum);
355+
356+
/* From Lua 5.3. */
357+
LUA_API int lua_isyieldable (lua_State *L);
350358

351359

352360
struct lua_Debug {

0 commit comments

Comments
 (0)