From aef61d90c5929a9ead11282ad604f1d1dcedf4a7 Mon Sep 17 00:00:00 2001 From: Adam Cozzette Date: Wed, 1 Feb 2023 14:53:14 -0800 Subject: [PATCH] Fix the Linux CMake Shared test run The StripSourceRetentionOptions() function needs to be marked with `PROTOC_EXPORT` so that it's visible on libprotoc.so. PiperOrigin-RevId: 506430373 --- src/google/protobuf/compiler/retention.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/google/protobuf/compiler/retention.h b/src/google/protobuf/compiler/retention.h index 1c6422e939..b97ab1e73a 100644 --- a/src/google/protobuf/compiler/retention.h +++ b/src/google/protobuf/compiler/retention.h @@ -34,16 +34,22 @@ #include "google/protobuf/descriptor.h" #include "google/protobuf/descriptor.pb.h" +// Must appear last +#include "google/protobuf/port_def.inc" + namespace google { namespace protobuf { namespace compiler { // Returns a FileDescriptorProto for this file, with all RETENTION_SOURCE // options stripped out. -FileDescriptorProto StripSourceRetentionOptions(const FileDescriptor& file); +PROTOC_EXPORT FileDescriptorProto +StripSourceRetentionOptions(const FileDescriptor& file); } // namespace compiler } // namespace protobuf } // namespace google +#include "google/protobuf/port_undef.inc" + #endif // GOOGLE_PROTOBUF_COMPILER_RETENTION_H__