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; }