summaryrefslogtreecommitdiff
path: root/xmake/core/base/bytes.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-09-18 13:45:41 +0800
committerruki <[email protected]>2021-09-18 13:45:41 +0800
commit7065563ba5be2117b8ed9d194204d33ff73291bd (patch)
treec0db81b9b71729cd403b2c6e166453920146638f /xmake/core/base/bytes.lua
parent52164d9f27178104817dd5478604ea433b543964 (diff)
disable bytes for lua
Diffstat (limited to 'xmake/core/base/bytes.lua')
-rw-r--r--xmake/core/base/bytes.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/xmake/core/base/bytes.lua b/xmake/core/base/bytes.lua
index 6cebbdf2b..359a67f36 100644
--- a/xmake/core/base/bytes.lua
+++ b/xmake/core/base/bytes.lua
@@ -24,16 +24,18 @@ local _instance = _instance or {}
-- load modules
local bit = require("base/bit")
-local ffi = require("ffi")
+local ffi = xmake._LUAJIT and require("ffi") or nil
local os = require("base/os")
local utils = require("base/utils")
local todisplay = require("base/todisplay")
-- define ffi interfaces
-ffi.cdef[[
- void* malloc(size_t size);
- void free(void* data);
-]]
+if ffi then
+ ffi.cdef[[
+ void* malloc(size_t size);
+ void free(void* data);
+ ]]
+end
-- new a bytes instance
--