From fd24b1bef4a5969ca1e1875e53e31f866e4b757b Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Tue, 22 Aug 2023 09:20:49 -0700 Subject: [PATCH] Export the constants in protobuf's any.h to support DLL builds. The issue is that if another component (MediaPipe in this case) calls PackFrom, there'll be linker errors because kTypeGoogleApisComPrefix wasn't found. PiperOrigin-RevId: 559132962 --- src/google/protobuf/any.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/google/protobuf/any.h b/src/google/protobuf/any.h index ab71a6c58e..3af3b229e4 100644 --- a/src/google/protobuf/any.h +++ b/src/google/protobuf/any.h @@ -48,9 +48,12 @@ class Message; namespace internal { -extern const char kAnyFullTypeName[]; // "google.protobuf.Any". -extern const char kTypeGoogleApisComPrefix[]; // "type.googleapis.com/". -extern const char kTypeGoogleProdComPrefix[]; // "type.googleprod.com/". +// "google.protobuf.Any". +PROTOBUF_EXPORT extern const char kAnyFullTypeName[]; +// "type.googleapis.com/". +PROTOBUF_EXPORT extern const char kTypeGoogleApisComPrefix[]; +// "type.googleprod.com/". +PROTOBUF_EXPORT extern const char kTypeGoogleProdComPrefix[]; std::string GetTypeUrl(absl::string_view message_name, absl::string_view type_url_prefix);