diff options
author | Bogdan Drutu <bdrutu@google.com> | 2015-12-12 15:39:40 -0800 |
---|---|---|
committer | Bogdan Drutu <bdrutu@google.com> | 2015-12-12 15:39:40 -0800 |
commit | 6af31bd04fdae82478c20dd48e78ff3f283e54ab (patch) | |
tree | 0b509a067745b7574c1f42487c2dcc39fa53278f /src | |
parent | 4a4a20b6f4a05c34104ce1f821d2cddf3d95a127 (diff) |
Fix the naming conflict issue that cause the tests to fail.
Diffstat (limited to 'src')
-rw-r--r-- | src/cpp/client/client_context.cc | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/cpp/client/client_context.cc b/src/cpp/client/client_context.cc index a4fdfcb0de..2aa532808c 100644 --- a/src/cpp/client/client_context.cc +++ b/src/cpp/client/client_context.cc @@ -45,14 +45,16 @@ namespace grpc { -class DefaultGlobalCallbacks GRPC_FINAL : public ClientContext::GlobalCallbacks { +class DefaultGlobalClientCallbacks GRPC_FINAL + : public ClientContext::GlobalCallbacks { public: void DefaultConstructor(ClientContext* context) GRPC_OVERRIDE {} void Destructor(ClientContext* context) GRPC_OVERRIDE {} }; -static DefaultGlobalCallbacks g_default_callbacks; -static ClientContext::GlobalCallbacks* g_callbacks = &g_default_callbacks; +static DefaultGlobalClientCallbacks g_default_client_callbacks; +static ClientContext::GlobalCallbacks* g_client_callbacks = + &g_default_client_callbacks; ClientContext::ClientContext() : initial_metadata_received_(false), @@ -60,14 +62,14 @@ ClientContext::ClientContext() call_canceled_(false), deadline_(gpr_inf_future(GPR_CLOCK_REALTIME)), propagate_from_call_(nullptr) { - g_callbacks->DefaultConstructor(this); + g_client_callbacks->DefaultConstructor(this); } ClientContext::~ClientContext() { if (call_) { grpc_call_destroy(call_); } - g_callbacks->Destructor(this); + g_client_callbacks->Destructor(this); } std::unique_ptr<ClientContext> ClientContext::FromServerContext( @@ -136,11 +138,11 @@ grpc::string ClientContext::peer() const { return peer; } -void ClientContext::SetGlobalCallbacks(GlobalCallbacks* callbacks) { - GPR_ASSERT(g_callbacks == &g_default_callbacks); - GPR_ASSERT(callbacks != NULL); - GPR_ASSERT(callbacks != &g_default_callbacks); - g_callbacks = callbacks; +void ClientContext::SetGlobalCallbacks(GlobalCallbacks* client_callbacks) { + GPR_ASSERT(g_client_callbacks == &g_default_client_callbacks); + GPR_ASSERT(client_callbacks != NULL); + GPR_ASSERT(client_callbacks != &g_default_client_callbacks); + g_client_callbacks = client_callbacks; } } // namespace grpc |