diff --git a/amalgamate.py b/amalgamate.py index 232f739..2ac22b8 100644 --- a/amalgamate.py +++ b/amalgamate.py @@ -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")