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

Unified Diff: third_party/protobuf/patches/0012-extract-globals.patch

Issue 2746493002: Reland of Statically link libprotobuf_lite on Linux (Closed)
Patch Set: Really fix Win dbg Created 3 years, 9 months 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/0012-extract-globals.patch
diff --git a/third_party/protobuf/patches/0012-extract-globals.patch b/third_party/protobuf/patches/0012-extract-globals.patch
new file mode 100644
index 0000000000000000000000000000000000000000..c7b9a8bcd8126d9d72ac788b4b0e55245a8b2dfd
--- /dev/null
+++ b/third_party/protobuf/patches/0012-extract-globals.patch
@@ -0,0 +1,66 @@
+diff -ru --new-file protobuf/src/google/protobuf/generated_message_util.cc protobuf2/src/google/protobuf/generated_message_util.cc
+--- protobuf/src/google/protobuf/generated_message_util.cc 2017-03-14 18:07:36.280818971 -0700
++++ protobuf2/src/google/protobuf/generated_message_util.cc 2017-03-14 18:07:25.596809777 -0700
+@@ -48,20 +48,18 @@
+ return std::numeric_limits<double>::quiet_NaN();
+ }
+
+-const ::std::string* empty_string_;
+-GOOGLE_PROTOBUF_DECLARE_ONCE(empty_string_once_init_);
+-
+ void DeleteEmptyString() {
+- delete empty_string_;
++ delete cr_empty_string_;
+ }
+
+ void InitEmptyString() {
+- empty_string_ = new string;
++ cr_empty_string_ = new string;
+ OnShutdown(&DeleteEmptyString);
+ }
+
+ const ::std::string& GetEmptyString() {
+- ::google::protobuf::GoogleOnceInit(&empty_string_once_init_, &InitEmptyString);
++ ::google::protobuf::GoogleOnceInit(&cr_empty_string_once_init_,
++ &InitEmptyString);
+ return GetEmptyStringAlreadyInited();
+ }
+
+diff -ru --new-file protobuf/src/google/protobuf/generated_message_util.h protobuf2/src/google/protobuf/generated_message_util.h
+--- protobuf/src/google/protobuf/generated_message_util.h 2017-03-14 18:07:36.280818971 -0700
++++ protobuf2/src/google/protobuf/generated_message_util.h 2017-03-14 18:07:25.424809629 -0700
+@@ -77,14 +77,14 @@
+
+ // Default empty string object. Don't use the pointer directly. Instead, call
+ // GetEmptyString() to get the reference.
+-LIBPROTOBUF_EXPORT extern const ::std::string* empty_string_;
+-LIBPROTOBUF_EXPORT extern ProtobufOnceType empty_string_once_init_;
++LIBPROTOBUF_EXPORT extern const ::std::string* cr_empty_string_;
++LIBPROTOBUF_EXPORT extern ProtobufOnceType cr_empty_string_once_init_;
+ LIBPROTOBUF_EXPORT void InitEmptyString();
+
+
+ LIBPROTOBUF_EXPORT inline const ::std::string& GetEmptyStringAlreadyInited() {
+- assert(empty_string_ != NULL);
+- return *empty_string_;
++ assert(cr_empty_string_ != NULL);
++ return *cr_empty_string_;
+ }
+
+ LIBPROTOBUF_EXPORT const ::std::string& GetEmptyString();
+diff -ru --new-file protobuf/src/google/protobuf/globals.cc protobuf2/src/google/protobuf/globals.cc
+--- protobuf/src/google/protobuf/globals.cc 1969-12-31 16:00:00.000000000 -0800
++++ protobuf2/src/google/protobuf/globals.cc 2017-03-14 18:07:25.412809619 -0700
+@@ -0,0 +1,12 @@
++#include <google/protobuf/generated_message_util.h>
++
++namespace google {
++namespace protobuf {
++namespace internal {
++
++const ::std::string* cr_empty_string_;
++GOOGLE_PROTOBUF_DECLARE_ONCE(cr_empty_string_once_init_);
++
++} // namespace internal
++} // namespace protobuf
++} // namespace google
« no previous file with comments | « third_party/protobuf/README.chromium ('k') | third_party/protobuf/src/google/protobuf/generated_message_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698