File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -17,15 +17,15 @@ extern "C" {
1717 }
1818#endif
1919
20- #if defined(LUA_VERSION_NUM ) && LUA_VERSION_NUM = = 504
20+ #if defined(LUA_VERSION_NUM ) && LUA_VERSION_NUM > = 504
2121
2222#if !defined(LUA_ERRGCMM )
23- /* So Lua 5.4 actually removes this, which breaks sol2...
23+ /* So Lua 5.4 or later actually removes this, which breaks sol2...
2424 man, this API is quite unstable...!
2525*/
2626# define LUA_ERRGCMM (LUA_ERRERR + 2)
2727#endif /* LUA_ERRGCMM define */
2828
29- #endif // Lua 5.4 only
29+ #endif // Lua 5.4 or later
3030
3131#endif // NOT_KEPLER_PROJECT_COMPAT54_H_
Original file line number Diff line number Diff line change 2727#include < sol/state_view.hpp>
2828#include < sol/thread.hpp>
2929
30+ #if LUA_VERSION_NUM >= 505
31+ # define sol_lua_newstate (f, ud ) lua_newstate(f, ud, 0 )
32+ #else
33+ # define sol_lua_newstate (f, ud ) lua_newstate(f, ud)
34+ #endif
35+
3036namespace sol {
3137
3238 class state : private std ::unique_ptr<lua_State, detail::state_deleter>, public state_view {
@@ -39,7 +45,7 @@ namespace sol {
3945 }
4046
4147 state (lua_CFunction panic, lua_Alloc alfunc, void * alpointer = nullptr )
42- : unique_base(lua_newstate (alfunc, alpointer)), state_view(unique_base::get()) {
48+ : unique_base(sol_lua_newstate (alfunc, alpointer)), state_view(unique_base::get()) {
4349 set_default_state (unique_base::get (), panic);
4450 }
4551
You can’t perform that action at this time.
0 commit comments