From 005154d448a80a74e8adc04b97cc76101cab2a45 Mon Sep 17 00:00:00 2001 From: sup817ch Date: Fri, 27 Mar 2026 20:01:21 +0800 Subject: [PATCH] Force __has_include checks on in amalgamation --- amalgamate.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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")