Force __has_include checks on in amalgamation

This commit is contained in:
sup817ch
2026-03-27 20:01:21 +08:00
parent 27ab6ab744
commit 005154d448
+9 -5
View File
@@ -70,11 +70,15 @@ def main():
with open("out/LICENSE", "w") as f:
f.write(license)
out_path = "out/phnt.h"
exec(f"\"{cpp_amalgamate}\" -d systeminformer/phnt/include phnt_amalgamate.h -o \"{out_path}\"")
with open(out_path, "r") as f:
header = f.read()
with open(out_path, "w") as f:
f.write("/*\n\n")
exec(f"\"{cpp_amalgamate}\" -d systeminformer/phnt/include phnt_amalgamate.h -o \"{out_path}\"")
with open(out_path, "r") as f:
header = f.read()
header = header.replace(
"#if __has_include (",
"#if 1 // __has_include ("
)
with open(out_path, "w") as f:
f.write("/*\n\n")
f.write("+===========================================================+\n")
f.write("| THIS FILE WAS AUTOMATICALLY GENERATED |\n")
f.write("+===========================================================+\n")