Define lua_pushglobaltable only if it's not already defined
This fixes compatibility with moonjit, a luajit replacement that lies about which API level it implements. Also link more stuff statically on linux.
This commit is contained in:
parent
eac92d1b04
commit
b5d1712123
@ -234,6 +234,10 @@ if copt_platform == 'win'
|
||||
configure_file(input: input_and_output[0], output: input_and_output[1], copy: true)
|
||||
endforeach
|
||||
endif
|
||||
elif copt_platform == 'lin'
|
||||
if uopt_static != 'none'
|
||||
project_link_args = [ '-static-libgcc', '-static-libstdc++' ]
|
||||
endif
|
||||
endif
|
||||
|
||||
if copt_platform == 'mac' and uopt_lua == 'luajit'
|
||||
|
@ -19,11 +19,13 @@ void tpt_lua_getmainthread(lua_State *L)
|
||||
|
||||
#else
|
||||
|
||||
# ifndef lua_pushglobaltable // * Thank you moonjit
|
||||
// Implement function added in lua 5.2 that we now use
|
||||
void lua_pushglobaltable(lua_State *L)
|
||||
{
|
||||
lua_pushvalue(L, LUA_GLOBALSINDEX);
|
||||
}
|
||||
# endif
|
||||
|
||||
void tpt_lua_setmainthread(lua_State *L)
|
||||
{
|
||||
|
@ -17,7 +17,9 @@ LUALIB_API void tpt_lua_getmainthread(lua_State *L);
|
||||
#if LUA_VERSION_NUM >= 502
|
||||
LUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname);
|
||||
#else
|
||||
# ifndef lua_pushglobaltable // * Thank you moonjit
|
||||
LUALIB_API void (lua_pushglobaltable) (lua_State *L);
|
||||
# endif
|
||||
#endif
|
||||
int luaL_tostring(lua_State *L, int n);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user