Skip to content
Snippets Groups Projects
Commit 42a2e6f1 authored by Yang Gao's avatar Yang Gao
Browse files

Merge pull request #1039 from nicolasnoble/bytecount

Allowing us to import google::protobuf::int64.
parents a181d212 76497135
No related branches found
No related tags found
No related merge requests found
...@@ -42,9 +42,9 @@ ...@@ -42,9 +42,9 @@
#define GRPC_OVERRIDE override #define GRPC_OVERRIDE override
#endif #endif
#ifndef GRPC_CUSTOM_STRING #ifndef GRPC_CUSTOM_PROTOBUF_INT64
#include <string> #include <google/protobuf/stubs/common.h>
#define GRPC_CUSTOM_STRING std::string #define GRPC_CUSTOM_PROTOBUF_INT64 ::google::protobuf::int64
#endif #endif
#ifndef GRPC_CUSTOM_MESSAGE #ifndef GRPC_CUSTOM_MESSAGE
...@@ -52,6 +52,11 @@ ...@@ -52,6 +52,11 @@
#define GRPC_CUSTOM_MESSAGE ::google::protobuf::Message #define GRPC_CUSTOM_MESSAGE ::google::protobuf::Message
#endif #endif
#ifndef GRPC_CUSTOM_STRING
#include <string>
#define GRPC_CUSTOM_STRING std::string
#endif
#ifndef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM #ifndef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM
#include <google/protobuf/io/zero_copy_stream.h> #include <google/protobuf/io/zero_copy_stream.h>
#define GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ::google::protobuf::io::ZeroCopyOutputStream #define GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ::google::protobuf::io::ZeroCopyOutputStream
...@@ -66,6 +71,7 @@ typedef GRPC_CUSTOM_STRING string; ...@@ -66,6 +71,7 @@ typedef GRPC_CUSTOM_STRING string;
namespace protobuf { namespace protobuf {
typedef GRPC_CUSTOM_MESSAGE Message; typedef GRPC_CUSTOM_MESSAGE Message;
typedef GRPC_CUSTOM_PROTOBUF_INT64 int64;
namespace io { namespace io {
typedef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ZeroCopyOutputStream; typedef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ZeroCopyOutputStream;
......
...@@ -84,7 +84,7 @@ class GrpcBufferWriter GRPC_FINAL ...@@ -84,7 +84,7 @@ class GrpcBufferWriter GRPC_FINAL
byte_count_ -= count; byte_count_ -= count;
} }
gpr_int64 ByteCount() const GRPC_OVERRIDE { return byte_count_; } grpc::protobuf::int64 ByteCount() const GRPC_OVERRIDE { return byte_count_; }
private: private:
const int block_size_; const int block_size_;
...@@ -142,7 +142,7 @@ class GrpcBufferReader GRPC_FINAL ...@@ -142,7 +142,7 @@ class GrpcBufferReader GRPC_FINAL
return false; return false;
} }
gpr_int64 ByteCount() const GRPC_OVERRIDE { grpc::protobuf::int64 ByteCount() const GRPC_OVERRIDE {
return byte_count_ - backup_count_; return byte_count_ - backup_count_;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment