diff --git a/include/grpc++/config.h b/include/grpc++/config.h index fd7672784b0..0267b852159 100644 --- a/include/grpc++/config.h +++ b/include/grpc++/config.h @@ -42,9 +42,9 @@ #define GRPC_OVERRIDE override #endif -#ifndef GRPC_CUSTOM_STRING -#include -#define GRPC_CUSTOM_STRING std::string +#ifndef GRPC_CUSTOM_PROTOBUF_INT64 +#include +#define GRPC_CUSTOM_PROTOBUF_INT64 ::google::protobuf::int64 #endif #ifndef GRPC_CUSTOM_MESSAGE @@ -52,6 +52,11 @@ #define GRPC_CUSTOM_MESSAGE ::google::protobuf::Message #endif +#ifndef GRPC_CUSTOM_STRING +#include +#define GRPC_CUSTOM_STRING std::string +#endif + #ifndef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM #include #define GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ::google::protobuf::io::ZeroCopyOutputStream @@ -66,6 +71,7 @@ typedef GRPC_CUSTOM_STRING string; namespace protobuf { typedef GRPC_CUSTOM_MESSAGE Message; +typedef GRPC_CUSTOM_PROTOBUF_INT64 int64; namespace io { typedef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ZeroCopyOutputStream; diff --git a/src/cpp/proto/proto_utils.cc b/src/cpp/proto/proto_utils.cc index acd204bf9b6..9254e5879f2 100644 --- a/src/cpp/proto/proto_utils.cc +++ b/src/cpp/proto/proto_utils.cc @@ -84,7 +84,7 @@ class GrpcBufferWriter GRPC_FINAL byte_count_ -= count; } - gpr_int64 ByteCount() const GRPC_OVERRIDE { return byte_count_; } + grpc::protobuf::int64 ByteCount() const GRPC_OVERRIDE { return byte_count_; } private: const int block_size_; @@ -142,7 +142,7 @@ class GrpcBufferReader GRPC_FINAL return false; } - gpr_int64 ByteCount() const GRPC_OVERRIDE { + grpc::protobuf::int64 ByteCount() const GRPC_OVERRIDE { return byte_count_ - backup_count_; }