[ObjC] Add PROTOC_EXPORT for the CMake unittest build/link.

These aren't public api, but this is currently need for how the CMake build is
configured.
pull/10720/head
Thomas Van Lenten 2 years ago
parent 2e49a8de95
commit 9a4514c17b
  1. 3
      src/google/protobuf/compiler/objectivec/generator.h
  2. 24
      src/google/protobuf/compiler/objectivec/line_consumer.h
  3. 3
      src/google/protobuf/compiler/objectivec/names.h
  4. 10
      src/google/protobuf/compiler/objectivec/text_format_decode_data.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 {

@ -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__

@ -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 {

@ -34,14 +34,20 @@
#include <string>
#include <vector>
// 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__

Loading…
Cancel
Save