diff --git a/include/grpc++/config.h b/include/grpc++/config.h index 327ed7a549a4dbf1c1d988a62fe015c5a4f21e1c..fd7672784b03c6a0cd0c77ba94d3cc44387fc604 100644 --- a/include/grpc++/config.h +++ b/include/grpc++/config.h @@ -52,12 +52,26 @@ #define GRPC_CUSTOM_MESSAGE ::google::protobuf::Message #endif +#ifndef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM +#include <google/protobuf/io/zero_copy_stream.h> +#define GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ::google::protobuf::io::ZeroCopyOutputStream +#define GRPC_CUSTOM_ZEROCOPYINPUTSTREAM ::google::protobuf::io::ZeroCopyInputStream +#endif + + namespace grpc { typedef GRPC_CUSTOM_STRING string; namespace protobuf { + typedef GRPC_CUSTOM_MESSAGE Message; + +namespace io { +typedef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ZeroCopyOutputStream; +typedef GRPC_CUSTOM_ZEROCOPYINPUTSTREAM ZeroCopyInputStream; +} // namespace io + } // namespace protobuf } // namespace grpc diff --git a/src/compiler/config.h b/src/compiler/config.h index dc8803ceab5f402869467540fb089aa48199feaf..e81de8d6c8f43aab15850b770a416a882a0c49dc 100644 --- a/src/compiler/config.h +++ b/src/compiler/config.h @@ -54,12 +54,10 @@ #ifndef GRPC_CUSTOM_PRINTER #include <google/protobuf/io/coded_stream.h> #include <google/protobuf/io/printer.h> -#include <google/protobuf/io/zero_copy_stream.h> #include <google/protobuf/io/zero_copy_stream_impl_lite.h> #define GRPC_CUSTOM_PRINTER ::google::protobuf::io::Printer #define GRPC_CUSTOM_CODEDOUTPUTSTREAM ::google::protobuf::io::CodedOutputStream #define GRPC_CUSTOM_STRINGOUTPUTSTREAM ::google::protobuf::io::StringOutputStream -#define GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ::google::protobuf::io::ZeroCopyOutputStream #endif #ifndef GRPC_CUSTOM_PLUGINMAIN @@ -85,7 +83,6 @@ namespace io { typedef GRPC_CUSTOM_PRINTER Printer; typedef GRPC_CUSTOM_CODEDOUTPUTSTREAM CodedOutputStream; typedef GRPC_CUSTOM_STRINGOUTPUTSTREAM StringOutputStream; -typedef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ZeroCopyOutputStream; } // namespace io } // namespace protobuf } // namespace grpc diff --git a/src/cpp/proto/proto_utils.cc b/src/cpp/proto/proto_utils.cc index e4e51bfebf5e78d048cf6ce447b105307dbc48b1..acd204bf9b627c2bae7a5633aaeeacc4789f2df4 100644 --- a/src/cpp/proto/proto_utils.cc +++ b/src/cpp/proto/proto_utils.cc @@ -39,12 +39,11 @@ #include <grpc/support/slice.h> #include <grpc/support/slice_buffer.h> #include <grpc/support/port_platform.h> -#include <google/protobuf/io/zero_copy_stream.h> const int kMaxBufferLength = 8192; class GrpcBufferWriter GRPC_FINAL - : public ::google::protobuf::io::ZeroCopyOutputStream { + : public ::grpc::protobuf::io::ZeroCopyOutputStream { public: explicit GrpcBufferWriter(grpc_byte_buffer **bp, int block_size = kMaxBufferLength) @@ -97,7 +96,7 @@ class GrpcBufferWriter GRPC_FINAL }; class GrpcBufferReader GRPC_FINAL - : public ::google::protobuf::io::ZeroCopyInputStream { + : public ::grpc::protobuf::io::ZeroCopyInputStream { public: explicit GrpcBufferReader(grpc_byte_buffer *buffer) : byte_count_(0), backup_count_(0) {