From 1cea8b8df6ffb528f361cb64ae6081d8525d8a87 Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Sat, 9 Dec 2023 23:37:14 +0100 Subject: [PATCH] Ensure that the has_* file actually has data in them. The previous PR had clearly never been tested --- scripts/genie.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/genie.lua b/scripts/genie.lua index 9bf68e14a76..001b81339ae 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -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()