message_lite.h: Use PROTOBUF_EXPORT_TEMPLATE_DECLARE with extern template

Export extern templates in message_lite.h to avoid missing symbols when
linking protobuf-lite.so.

PiperOrigin-RevId: 580556084
pull/14692/head
Protobuf Team Bot 1 year ago committed by Copybara-Service
parent 24fef03259
commit e6f8b9d102
  1. 32
      src/google/protobuf/message_lite.h

@ -616,22 +616,22 @@ namespace internal {
template <bool alias>
bool MergeFromImpl(absl::string_view input, MessageLite* msg,
MessageLite::ParseFlags parse_flags);
extern template bool MergeFromImpl<false>(absl::string_view input,
MessageLite* msg,
MessageLite::ParseFlags parse_flags);
extern template bool MergeFromImpl<true>(absl::string_view input,
MessageLite* msg,
MessageLite::ParseFlags parse_flags);
extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl<false>(
absl::string_view input, MessageLite* msg,
MessageLite::ParseFlags parse_flags);
extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl<true>(
absl::string_view input, MessageLite* msg,
MessageLite::ParseFlags parse_flags);
template <bool alias>
bool MergeFromImpl(io::ZeroCopyInputStream* input, MessageLite* msg,
MessageLite::ParseFlags parse_flags);
extern template bool MergeFromImpl<false>(io::ZeroCopyInputStream* input,
MessageLite* msg,
MessageLite::ParseFlags parse_flags);
extern template bool MergeFromImpl<true>(io::ZeroCopyInputStream* input,
MessageLite* msg,
MessageLite::ParseFlags parse_flags);
extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl<false>(
io::ZeroCopyInputStream* input, MessageLite* msg,
MessageLite::ParseFlags parse_flags);
extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl<true>(
io::ZeroCopyInputStream* input, MessageLite* msg,
MessageLite::ParseFlags parse_flags);
struct BoundedZCIS {
io::ZeroCopyInputStream* zcis;
@ -641,10 +641,10 @@ struct BoundedZCIS {
template <bool alias>
bool MergeFromImpl(BoundedZCIS input, MessageLite* msg,
MessageLite::ParseFlags parse_flags);
extern template bool MergeFromImpl<false>(BoundedZCIS input, MessageLite* msg,
MessageLite::ParseFlags parse_flags);
extern template bool MergeFromImpl<true>(BoundedZCIS input, MessageLite* msg,
MessageLite::ParseFlags parse_flags);
extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl<false>(
BoundedZCIS input, MessageLite* msg, MessageLite::ParseFlags parse_flags);
extern template PROTOBUF_EXPORT_TEMPLATE_DECLARE bool MergeFromImpl<true>(
BoundedZCIS input, MessageLite* msg, MessageLite::ParseFlags parse_flags);
template <typename T>
struct SourceWrapper;

Loading…
Cancel
Save