mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
Add guard for luaL_loadbufferx
This commit is contained in:
parent
d451271bf4
commit
cb0116a3df
|
@ -158,6 +158,9 @@ inline const char* kepler_lua_compat_get_string(lua_State* L, void* ud, size_t*
|
|||
return ls->s;
|
||||
}
|
||||
|
||||
#if !defined(SOL_LUAJIT) || ((SOL_LUAJIT_VERSION - 020100) <= 0)
|
||||
// Luajit 2.1.0 has this function already
|
||||
|
||||
inline int luaL_loadbufferx(lua_State* L, const char* buff, size_t size, const char* name, const char*) {
|
||||
kepler_lua_compat_get_string_view ls;
|
||||
ls.s = buff;
|
||||
|
@ -165,6 +168,8 @@ inline int luaL_loadbufferx(lua_State* L, const char* buff, size_t size, const c
|
|||
return lua_load(L, kepler_lua_compat_get_string, &ls, name/*, mode*/);
|
||||
}
|
||||
|
||||
#endif // LuaJIT 2.1.x beta and beyond
|
||||
|
||||
#endif /* Lua 5.1 */
|
||||
|
||||
#endif // SOL_5_1_0_H
|
|
@ -42,6 +42,7 @@
|
|||
#ifdef LUAJIT_VERSION
|
||||
#ifndef SOL_LUAJIT
|
||||
#define SOL_LUAJIT
|
||||
#define SOL_LUAJIT_VERSION LUAJIT_VERSION_NUM
|
||||
#endif // sol luajit
|
||||
#endif // luajit
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user