summaryrefslogtreecommitdiff
path: root/xmake/core/base/libc.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/core/base/libc.lua')
-rw-r--r--xmake/core/base/libc.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/xmake/core/base/libc.lua b/xmake/core/base/libc.lua
index d3f02d7f5..6e69dd203 100644
--- a/xmake/core/base/libc.lua
+++ b/xmake/core/base/libc.lua
@@ -31,6 +31,7 @@ libc._dataptr = libc._dataptr or libc.dataptr
libc._ptraddr = libc._ptraddr or libc.ptraddr
libc._diffptr = libc._diffptr or libc.diffptr
libc._byteof = libc._byteof or libc.byteof
+libc._setbyte = libc._setbyte or libc.setbyte
-- load modules
local ffi = xmake._LUAJIT and require("ffi")
@@ -103,6 +104,14 @@ function libc.byteof(data, offset)
end
end
+function libc.setbyte(data, offset, value)
+ if ffi then
+ data[offset] = value
+ else
+ return libc._setbyte(data, offset, value)
+ end
+end
+
function libc.diffptr(data, offset)
if ffi then
return data + offset