diff --git a/src/google/protobuf/compiler/objectivec/generator.h b/src/google/protobuf/compiler/objectivec/generator.h index acd9ce895f..8b4e1292e7 100644 --- a/src/google/protobuf/compiler/objectivec/generator.h +++ b/src/google/protobuf/compiler/objectivec/generator.h @@ -37,9 +37,8 @@ #include "google/protobuf/compiler/code_generator.h" #include "google/protobuf/descriptor.h" -// clang-format off +// Must be included last #include "google/protobuf/port_def.inc" -// clang-format on namespace google { namespace protobuf { diff --git a/src/google/protobuf/compiler/objectivec/line_consumer.h b/src/google/protobuf/compiler/objectivec/line_consumer.h index 41fdb5b383..15a935b6b0 100644 --- a/src/google/protobuf/compiler/objectivec/line_consumer.h +++ b/src/google/protobuf/compiler/objectivec/line_consumer.h @@ -36,31 +36,39 @@ #include "google/protobuf/io/zero_copy_stream.h" +// Must be included last +#include "google/protobuf/port_def.inc" + namespace google { namespace protobuf { namespace compiler { namespace objectivec { +// TODO(b/250947994): PROTOC_EXPORT is only used to allow the CMake build to +// find/link these in the unittest, this is not public api. + // Helper for parsing simple files. -class LineConsumer { +class PROTOC_EXPORT LineConsumer { public: LineConsumer(); virtual ~LineConsumer(); virtual bool ConsumeLine(const absl::string_view& line, std::string* out_error) = 0; }; -bool ParseSimpleFile(const std::string& path, - LineConsumer* line_consumer, - std::string* out_error); +bool PROTOC_EXPORT ParseSimpleFile(const std::string& path, + LineConsumer* line_consumer, + std::string* out_error); -bool ParseSimpleStream(io::ZeroCopyInputStream& input_stream, - const std::string& stream_name, - LineConsumer* line_consumer, - std::string* out_error); +bool PROTOC_EXPORT ParseSimpleStream(io::ZeroCopyInputStream& input_stream, + const std::string& stream_name, + LineConsumer* line_consumer, + std::string* out_error); } // namespace objectivec } // namespace compiler } // namespace protobuf } // namespace google +#include "google/protobuf/port_undef.inc" + #endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_LINE_CONSUMER_H__ diff --git a/src/google/protobuf/compiler/objectivec/names.h b/src/google/protobuf/compiler/objectivec/names.h index e10370ff27..e1b703c7bc 100644 --- a/src/google/protobuf/compiler/objectivec/names.h +++ b/src/google/protobuf/compiler/objectivec/names.h @@ -39,9 +39,8 @@ #include "google/protobuf/descriptor.h" #include "google/protobuf/io/zero_copy_stream.h" -// clang-format off +// Must be included last #include "google/protobuf/port_def.inc" -// clang-format on namespace google { namespace protobuf { diff --git a/src/google/protobuf/compiler/objectivec/text_format_decode_data.h b/src/google/protobuf/compiler/objectivec/text_format_decode_data.h index c88fae31f8..e7b63f65ff 100644 --- a/src/google/protobuf/compiler/objectivec/text_format_decode_data.h +++ b/src/google/protobuf/compiler/objectivec/text_format_decode_data.h @@ -34,14 +34,20 @@ #include #include +// Must be included last +#include "google/protobuf/port_def.inc" + namespace google { namespace protobuf { namespace compiler { namespace objectivec { +// TODO(b/250947994): PROTOC_EXPORT is only used to allow the CMake build to +// find/link these in the unittest, this is not public api. + // Generate decode data needed for ObjC's GPBDecodeTextFormatName() to transform // the input into the expected output. -class TextFormatDecodeData { +class PROTOC_EXPORT TextFormatDecodeData { public: TextFormatDecodeData(); ~TextFormatDecodeData(); @@ -68,4 +74,6 @@ class TextFormatDecodeData { } // namespace protobuf } // namespace google +#include "google/protobuf/port_undef.inc" + #endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_TEXT_FORMAT_DECODE_DATA_H__