--- a/src/google/protobuf/compiler/cpp/file.cc (index) +++ b/src/google/protobuf/compiler/cpp/file.cc (working tree) @@ -188,9 +188,9 @@ void FileGenerator::GenerateMacroUndefs(io::Printer* p) { } p->Emit({{"name", TProtoStringType(name)}}, R"( - #ifdef $name$ - #undef $name$ - #endif // $name$ + #)" "ifdef" R"( $name$ + #)" "undef" R"( $name$ + #)" "endif" R"( // $name$ )"); } } @@ -285,7 +285,7 @@ void FileGenerator::GenerateProtoHeader(io::Printer* p, } if (IsBootstrapProto(options_, file_)) { p->Emit({{"name", StripProto(file_->name())}}, R"cc( - // IWYU pragma: private, include "$name$.proto.h" + // IWYU pragma: private, include "$name$.pb.h" )cc"); } @@ -297,7 +297,7 @@ void FileGenerator::GenerateProtoHeader(io::Printer* p, for (int i = 0; i < file_->public_dependency_count(); ++i) { const FileDescriptor* dep = file_->public_dependency(i); p->Emit({{"name", StripProto(dep->name())}}, R"( - #include "$name$.proto.h" + #)" R"(include "$name$.pb.h" )"); } }}, @@ -443,7 +443,7 @@ void FileGenerator::GenerateSourceIncludes(io::Printer* p) { // Generated by the protocol buffer compiler. DO NOT EDIT! // source: $filename$ - #include $h_include$ + #)" "include" R"( $h_include$ #include )"); @@ -485,7 +485,7 @@ void FileGenerator::GenerateSourceIncludes(io::Printer* p) { GetBootstrapBasename(options_, basename, &basename); } p->Emit({{"name", basename}}, R"( - #include "$name$.proto.h" + #)" R"(include "$name$.pb.h" )"); } } @@ -1390,9 +1390,8 @@ void FileGenerator::GenerateDependencyIncludes(io::Printer* p) { p->Emit( {{"name", CreateHeaderInclude(absl::StrCat(basename, ".pb.h"), dep)}}, - R"( - #include $name$ - )"); + "#" "include" "$name$\n" + ); } }