diff --git a/src/google/protobuf/generated_message_util.cc b/src/google/protobuf/generated_message_util.cc index 4edc317..35b1c92 100644 --- a/src/google/protobuf/generated_message_util.cc +++ b/src/google/protobuf/generated_message_util.cc @@ -111,6 +111,11 @@ void InitProtobufDefaultsSlow() { PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 static std::true_type init_empty_string = (InitProtobufDefaultsSlow(), std::true_type{}); +const std::string& GetEmptyString() { + InitProtobufDefaults(); + return GetEmptyStringAlreadyInited(); +} + template const T& Get(const void* ptr) { return *static_cast(ptr); diff --git a/src/google/protobuf/generated_message_util.h b/src/google/protobuf/generated_message_util.h index 9340f24..6b64840 100644 --- a/src/google/protobuf/generated_message_util.h +++ b/src/google/protobuf/generated_message_util.h @@ -82,10 +82,7 @@ PROTOBUF_EXPORT inline void InitProtobufDefaults() { // This used by proto1 PROTOBUF_FUTURE_ADD_EARLY_NODISCARD -PROTOBUF_EXPORT inline const std::string& GetEmptyString() { - InitProtobufDefaults(); - return GetEmptyStringAlreadyInited(); -} +PROTOBUF_EXPORT const ::std::string& GetEmptyString(); // Default empty Cord object. Don't use directly. Instead, call // GetEmptyCordAlreadyInited() to get the reference.