1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
--- 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 <algorithm>
)");
@@ -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"
+ );
}
}
|