diff options
Diffstat (limited to 'src/google/protobuf/implicit_weak_message.cc')
-rw-r--r-- | src/google/protobuf/implicit_weak_message.cc | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/google/protobuf/implicit_weak_message.cc b/src/google/protobuf/implicit_weak_message.cc index 7a1d4446..7e47cdcc 100644 --- a/src/google/protobuf/implicit_weak_message.cc +++ b/src/google/protobuf/implicit_weak_message.cc @@ -30,8 +30,11 @@ #include <google/protobuf/implicit_weak_message.h> -#include <google/protobuf/stubs/once.h> #include <google/protobuf/io/zero_copy_stream_impl_lite.h> +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +#include <google/protobuf/parse_context.h> +#endif +#include <google/protobuf/stubs/once.h> #include <google/protobuf/wire_format_lite.h> namespace google { @@ -44,17 +47,26 @@ bool ImplicitWeakMessage::MergePartialFromCodedStream(io::CodedInputStream* inpu return WireFormatLite::SkipMessage(input, &coded_stream); } -::google::protobuf::internal::ExplicitlyConstructed<ImplicitWeakMessage> +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* ImplicitWeakMessage::_InternalParse(const char* begin, + const char* end, void* object, + ParseContext* ctx) { + return internal::StringParser( + begin, end, &(static_cast<ImplicitWeakMessage*>(object)->data_), ctx); +} +#endif + +ExplicitlyConstructed<ImplicitWeakMessage> implicit_weak_message_default_instance; -GOOGLE_PROTOBUF_DECLARE_ONCE(implicit_weak_message_once_init_); +internal::once_flag 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); + internal::call_once(implicit_weak_message_once_init_, + InitImplicitWeakMessageDefaultInstance); return &implicit_weak_message_default_instance.get(); } |