makesyscalls.lua: Add the ABI function prefix reliably.

The previous code mostly worked, but ended up adding bogus sys_<foo>()
declerations.

Reviewed by:	kevans
This commit is contained in:
Brooks Davis 2021-11-22 22:36:58 +00:00
parent 5e70931184
commit 804a84fbf2

View File

@ -1192,25 +1192,29 @@ process_syscall_def = function(line)
end
local argprefix = ''
local funcprefix = ''
if abi_changes("pointer_args") then
for _, v in ipairs(funcargs) do
if isptrtype(v["type"]) then
-- argalias should be:
-- COMPAT_PREFIX + ABI Prefix + funcname
argprefix = config['abi_func_prefix']
funcalias = config['abi_func_prefix'] ..
funcname
funcprefix = config['abi_func_prefix']
funcalias = funcprefix .. funcname
goto ptrfound
end
end
::ptrfound::
end
if funcname ~= nil then
funcname = funcprefix .. funcname
end
if funcalias == nil or funcalias == "" then
funcalias = funcname
end
if argalias == nil and funcname ~= nil then
argalias = argprefix .. funcname .. "_args"
argalias = funcname .. "_args"
for _, v in pairs(compat_options) do
local mask = v["mask"]
if (flags & mask) ~= 0 then