xref: /aosp_15_r20/external/cronet/third_party/protobuf/patches/0008-uninline_get_empty_string.patch (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1--- a/src/google/protobuf/generated_message_util.cc
2+++ b/src/google/protobuf/generated_message_util.cc
3@@ -83,6 +83,11 @@ void InitProtobufDefaults() {
4   (void)is_inited;
5 }
6
7+const std::string& GetEmptyString() {
8+  InitProtobufDefaults();
9+  return GetEmptyStringAlreadyInited();
10+}
11+
12 size_t StringSpaceUsedExcludingSelfLong(const std::string& str) {
13   const void* start = &str;
14   const void* end = &str + 1;
15--- a/src/google/protobuf/generated_message_util.h
16+++ b/src/google/protobuf/generated_message_util.h
17@@ -84,10 +84,7 @@ inline To DownCast(From& f) {
18 PROTOBUF_EXPORT void InitProtobufDefaults();
19
20 // This used by proto1
21-PROTOBUF_EXPORT inline const std::string& GetEmptyString() {
22-  InitProtobufDefaults();
23-  return GetEmptyStringAlreadyInited();
24-}
25+PROTOBUF_EXPORT const ::std::string& GetEmptyString();
26
27
28 // True if IsInitialized() is true for all elements of t.  Type is expected
29