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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 diff -ru --new-file protobuf/src/google/protobuf/generated_message_util.cc proto buf2/src/google/protobuf/generated_message_util.cc
2 --- protobuf/src/google/protobuf/generated_message_util.cc 2017-03-14 18:07 :36.280818971 -0700
3 +++ protobuf2/src/google/protobuf/generated_message_util.cc 2017-03-14 18:07 :25.596809777 -0700
4 @@ -48,20 +48,18 @@
5 return std::numeric_limits<double>::quiet_NaN();
6 }
7
8 -const ::std::string* empty_string_;
9 -GOOGLE_PROTOBUF_DECLARE_ONCE(empty_string_once_init_);
10 -
11 void DeleteEmptyString() {
12 - delete empty_string_;
13 + delete cr_empty_string_;
14 }
15
16 void InitEmptyString() {
17 - empty_string_ = new string;
18 + cr_empty_string_ = new string;
19 OnShutdown(&DeleteEmptyString);
20 }
21
22 const ::std::string& GetEmptyString() {
23 - ::google::protobuf::GoogleOnceInit(&empty_string_once_init_, &InitEmptyString );
24 + ::google::protobuf::GoogleOnceInit(&cr_empty_string_once_init_,
25 + &InitEmptyString);
26 return GetEmptyStringAlreadyInited();
27 }
28
29 diff -ru --new-file protobuf/src/google/protobuf/generated_message_util.h protob uf2/src/google/protobuf/generated_message_util.h
30 --- protobuf/src/google/protobuf/generated_message_util.h 2017-03-14 18:07 :36.280818971 -0700
31 +++ protobuf2/src/google/protobuf/generated_message_util.h 2017-03-14 18:07 :25.424809629 -0700
32 @@ -77,14 +77,14 @@
33
34 // Default empty string object. Don't use the pointer directly. Instead, call
35 // GetEmptyString() to get the reference.
36 -LIBPROTOBUF_EXPORT extern const ::std::string* empty_string_;
37 -LIBPROTOBUF_EXPORT extern ProtobufOnceType empty_string_once_init_;
38 +LIBPROTOBUF_EXPORT extern const ::std::string* cr_empty_string_;
39 +LIBPROTOBUF_EXPORT extern ProtobufOnceType cr_empty_string_once_init_;
40 LIBPROTOBUF_EXPORT void InitEmptyString();
41
42
43 LIBPROTOBUF_EXPORT inline const ::std::string& GetEmptyStringAlreadyInited() {
44 - assert(empty_string_ != NULL);
45 - return *empty_string_;
46 + assert(cr_empty_string_ != NULL);
47 + return *cr_empty_string_;
48 }
49
50 LIBPROTOBUF_EXPORT const ::std::string& GetEmptyString();
51 diff -ru --new-file protobuf/src/google/protobuf/globals.cc protobuf2/src/google /protobuf/globals.cc
52 --- protobuf/src/google/protobuf/globals.cc 1969-12-31 16:00:00.000000000 -0 800
53 +++ protobuf2/src/google/protobuf/globals.cc 2017-03-14 18:07:25.412809619 -0 700
54 @@ -0,0 +1,12 @@
55 +#include <google/protobuf/generated_message_util.h>
56 +
57 +namespace google {
58 +namespace protobuf {
59 +namespace internal {
60 +
61 +const ::std::string* cr_empty_string_;
62 +GOOGLE_PROTOBUF_DECLARE_ONCE(cr_empty_string_once_init_);
63 +
64 +} // namespace internal
65 +} // namespace protobuf
66 +} // namespace google
OLDNEW
« 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