Ensure that the has_* file actually has data in them. The previous PR had clearly never been tested

This commit is contained in:
Olivier Galibert 2023-12-09 23:37:14 +01:00
parent 1391683607
commit 1cea8b8df6

View File

@ -1530,11 +1530,16 @@ function generate_has_header(hashname, hash)
file:write(string.format("#ifndef GENERATED_HAS_%s_H\n", hashname))
file:write(string.format("#define GENERATED_HAS_%s_H\n", hashname))
file:write("\n")
for k, v in ipairs(hash) do
active = {}
for k, v in pairs(hash) do
if v then
file:write(string.format("#define HAS_%s_%s\n", hashname, k))
active[#active+1] = k
end
end
table.sort(active)
for _, k in ipairs(active) do
file:write(string.format("#define HAS_%s_%s\n", hashname, k))
end
file:write("\n")
file:write("#endif\n")
file:close()