Chromium Code Reviews| Index: third_party/protobuf/patches/0011-uninline_internal_default_instance.patch |
| diff --git a/third_party/protobuf/patches/0011-uninline_internal_default_instance.patch b/third_party/protobuf/patches/0011-uninline_internal_default_instance.patch |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cf8614373d8f4b28cd645b6f2c5f076968731993 |
| --- /dev/null |
| +++ b/third_party/protobuf/patches/0011-uninline_internal_default_instance.patch |
| @@ -0,0 +1,30 @@ |
| +diff --git a/src/google/protobuf/compiler/cpp/cpp_message.cc b/src/google/protobuf/compiler/cpp/cpp_message.cc |
| +index efc56dd..6743ac5 100644 |
| +--- a/src/google/protobuf/compiler/cpp/cpp_message.cc |
| ++++ b/src/google/protobuf/compiler/cpp/cpp_message.cc |
| +@@ -1565,12 +1565,6 @@ GenerateInlineMethods(io::Printer* printer, bool is_inline) { |
| + "_oneof_case_[$oneof_index$]);\n" |
| + "}\n"); |
| + } |
| +- |
| +- printer->Print( |
| +- "inline const $classname$* $classname$::internal_default_instance() {\n" |
| +- " return &$classname$_default_instance_.get();\n" |
|
Peter Kasting
2016/11/22 20:28:23
Is this needed because the relevant _default_insta
jbriance
2016/11/22 22:11:31
Yes, when "is_component_build=true" I get link err
|
| +- "}\n", |
| +- "classname", classname_); |
| + } |
| + |
| + void MessageGenerator:: |
| +@@ -2441,6 +2435,12 @@ GenerateStructors(io::Printer* printer) { |
| + "\n", |
| + "classname", classname_); |
| + |
| ++ printer->Print( |
| ++ "const $classname$* $classname$::internal_default_instance() {\n" |
| ++ " return &$classname$_default_instance_.get();\n" |
| ++ "}\n", |
| ++ "classname", classname_); |
| ++ |
| + if (SupportsArenas(descriptor_)) { |
| + printer->Print( |
| + "$classname$* $classname$::New(::google::protobuf::Arena* arena) const {\n" |