--- a/src/google/protobuf/generated_message_util.cc +++ b/src/google/protobuf/generated_message_util.cc @@ -83,6 +83,11 @@ void InitProtobufDefaults() { (void)is_inited; } +const std::string& GetEmptyString() { + InitProtobufDefaults(); + return GetEmptyStringAlreadyInited(); +} + size_t StringSpaceUsedExcludingSelfLong(const std::string& str) { const void* start = &str; const void* end = &str + 1; --- a/src/google/protobuf/generated_message_util.h +++ b/src/google/protobuf/generated_message_util.h @@ -84,10 +84,7 @@ inline To DownCast(From& f) { PROTOBUF_EXPORT void InitProtobufDefaults(); // This used by proto1 -PROTOBUF_EXPORT inline const std::string& GetEmptyString() { - InitProtobufDefaults(); - return GetEmptyStringAlreadyInited(); -} +PROTOBUF_EXPORT const ::std::string& GetEmptyString(); // True if IsInitialized() is true for all elements of t. Type is expected