diff --git a/include/grpc++/config.h b/include/grpc++/config.h index fd7672784b03c6a0cd0c77ba94d3cc44387fc604..0267b8521599237db822d785ae243f33cbdf3fa9 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 <string> -#define GRPC_CUSTOM_STRING std::string +#ifndef GRPC_CUSTOM_PROTOBUF_INT64 +#include <google/protobuf/stubs/common.h> +#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 <string> +#define GRPC_CUSTOM_STRING std::string +#endif + #ifndef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM #include <google/protobuf/io/zero_copy_stream.h> #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 acd204bf9b627c2bae7a5633aaeeacc4789f2df4..9254e5879f238a2a28b1f7ecd36670d2c9e3fcbf 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_; }