Added FFI enabled check

This commit is contained in:
Rinat Namazov 2021-05-13 22:24:31 +03:00 committed by The Phantom Derpstorm
parent f92c28b1b5
commit f5355395b7
2 changed files with 9 additions and 1 deletions

View File

@ -70,6 +70,14 @@
#define SOL_LUAJIT_VERSION_I_ 0
#endif
#if defined(SOL_LUAJIT_FFI_DISABLED)
#define SOL_LUAJIT_FFI_DISABLED_I_ SOL_ON
#elif defined(LUAJIT_DISABLE_FFI)
#define SOL_LUAJIT_FFI_DISABLED_I_ SOL_ON
#else
#define SOL_LUAJIT_FFI_DISABLED_I_ SOL_DEFAULT_OFF
#endif
#if defined(MOONJIT_VERSION)
#define SOL_USE_MOONJIT_I_ SOL_ON
#else

View File

@ -189,7 +189,7 @@ namespace sol {
#endif // Lua 5.3+ only
break;
case lib::ffi:
#if SOL_IS_ON(SOL_USE_LUAJIT_I_)
#if SOL_IS_ON(SOL_USE_LUAJIT_I_) && SOL_IS_OFF(SOL_LUAJIT_FFI_DISABLED_I_)
luaL_requiref(L, "ffi", luaopen_ffi, 1);
lua_pop(L, 1);
#endif // LuaJIT only