From ed1fa670e0fa211776e611bd6ffeaf8c58f41ace Mon Sep 17 00:00:00 2001 From: Matthieu HERNANDEZ Date: Thu, 17 Oct 2024 21:51:57 +0200 Subject: [PATCH] Fix pure1 file with -import-std --- source/to_cpp1.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/to_cpp1.h b/source/to_cpp1.h index 3e08d83e6d..dcded70466 100644 --- a/source/to_cpp1.h +++ b/source/to_cpp1.h @@ -1497,6 +1497,13 @@ class cppfront // if (!source.has_cpp2()) { assert(ret.cpp2_lines == 0); + if ( + cpp1_filename.back() == 'h' + && (flag_import_std || flag_include_std) + ) + { + printer.print_extra( "\n#endif" ); + } return ret; }