Merge pull request #1039 from nicolasnoble/bytecount

Allowing us to import google::protobuf::int64.
pull/1043/head
Yang Gao 10 years ago
commit 42a2e6f1b7
  1. 12
      include/grpc++/config.h
  2. 4
      src/cpp/proto/proto_utils.cc

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

@ -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_;
}

Loading…
Cancel
Save