diff options
Diffstat (limited to 'src/google/protobuf/implicit_weak_message.cc')
-rw-r--r-- | src/google/protobuf/implicit_weak_message.cc | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/google/protobuf/implicit_weak_message.cc b/src/google/protobuf/implicit_weak_message.cc index 0dd126be..7a1d4446 100644 --- a/src/google/protobuf/implicit_weak_message.cc +++ b/src/google/protobuf/implicit_weak_message.cc @@ -30,6 +30,7 @@ #include <google/protobuf/implicit_weak_message.h> +#include <google/protobuf/stubs/once.h> #include <google/protobuf/io/zero_copy_stream_impl_lite.h> #include <google/protobuf/wire_format_lite.h> @@ -37,15 +38,26 @@ namespace google { namespace protobuf { namespace internal { -::google::protobuf::internal::ExplicitlyConstructed<ImplicitWeakMessage> - implicit_weak_message_default_instance; - bool ImplicitWeakMessage::MergePartialFromCodedStream(io::CodedInputStream* input) { io::StringOutputStream string_stream(&data_); io::CodedOutputStream coded_stream(&string_stream, false); return WireFormatLite::SkipMessage(input, &coded_stream); } +::google::protobuf::internal::ExplicitlyConstructed<ImplicitWeakMessage> + implicit_weak_message_default_instance; +GOOGLE_PROTOBUF_DECLARE_ONCE(implicit_weak_message_once_init_); + +void InitImplicitWeakMessageDefaultInstance() { + implicit_weak_message_default_instance.DefaultConstruct(); +} + +const ImplicitWeakMessage* ImplicitWeakMessage::default_instance() { + ::google::protobuf::GoogleOnceInit(&implicit_weak_message_once_init_, + &InitImplicitWeakMessageDefaultInstance); + return &implicit_weak_message_default_instance.get(); +} + } // namespace internal } // namespace protobuf } // namespace google |