Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Unified Diff: third_party/protobuf/patches/0011-uninline_internal_default_instance.patch

Issue 2495533002: third_party/protobuf: Update to HEAD (83d681ee2c) (Closed)
Patch Set: Update to new HEAD (b7632464b4) + restore GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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"

Powered by Google App Engine
This is Rietveld 408576698