diff options
Diffstat (limited to 'include/grpc++/impl/rpc_service_method.h')
-rw-r--r-- | include/grpc++/impl/rpc_service_method.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/grpc++/impl/rpc_service_method.h b/include/grpc++/impl/rpc_service_method.h index fcb0b7ccce..b203c8f53a 100644 --- a/include/grpc++/impl/rpc_service_method.h +++ b/include/grpc++/impl/rpc_service_method.h @@ -34,6 +34,7 @@ #ifndef GRPCXX_IMPL_RPC_SERVICE_METHOD_H #define GRPCXX_IMPL_RPC_SERVICE_METHOD_H +#include <climits> #include <functional> #include <map> #include <memory> @@ -251,7 +252,11 @@ class RpcService { void AddMethod(RpcServiceMethod* method) { methods_.emplace_back(method); } RpcServiceMethod* GetMethod(int i) { return methods_[i].get(); } - int GetMethodCount() const { return methods_.size(); } + int GetMethodCount() const { + // On win x64, int is only 32bit + GPR_ASSERT(methods_.size() <= INT_MAX); + return (int)methods_.size(); + } private: std::vector<std::unique_ptr<RpcServiceMethod>> methods_; |