From d9b6fcfee4cb986f148762a4a7d0794de9b3ba62 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 7 Jul 2015 16:28:20 -0700 Subject: [PATCH] Support older compilers --- include/grpc++/server_builder.h | 4 ++-- src/cpp/server/server_builder.cc | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/grpc++/server_builder.h b/include/grpc++/server_builder.h index 2003d18ef52..d6bb3bd0906 100644 --- a/include/grpc++/server_builder.h +++ b/include/grpc++/server_builder.h @@ -121,8 +121,8 @@ class ServerBuilder { }; int max_message_size_; - std::vector> services_; - std::vector> async_services_; + std::vector>> services_; + std::vector>> async_services_; std::vector ports_; std::vector cqs_; std::shared_ptr creds_; diff --git a/src/cpp/server/server_builder.cc b/src/cpp/server/server_builder.cc index fa158c919eb..86c78f05ff9 100644 --- a/src/cpp/server/server_builder.cc +++ b/src/cpp/server/server_builder.cc @@ -51,21 +51,21 @@ std::unique_ptr ServerBuilder::AddCompletionQueue() { } void ServerBuilder::RegisterService(SynchronousService* service) { - services_.emplace_back(service->service()); + services_.emplace_back(new NamedService(service->service())); } void ServerBuilder::RegisterAsyncService(AsynchronousService* service) { - async_services_.emplace_back(service); + async_services_.emplace_back(new NamedService(service)); } void ServerBuilder::RegisterService( const grpc::string& addr, SynchronousService* service) { - services_.emplace_back(addr, service->service()); + services_.emplace_back(new NamedService(addr, service->service())); } void ServerBuilder::RegisterAsyncService( const grpc::string& addr, AsynchronousService* service) { - async_services_.emplace_back(addr, service); + async_services_.emplace_back(new NamedService(addr, service)); } void ServerBuilder::RegisterAsyncGenericService(AsyncGenericService* service) { @@ -107,13 +107,13 @@ std::unique_ptr ServerBuilder::BuildAndStart() { } for (auto service = services_.begin(); service != services_.end(); service++) { - if (!server->RegisterService(service->host.get(), service->service)) { + if (!server->RegisterService((*service)->host.get(), (*service)->service)) { return nullptr; } } for (auto service = async_services_.begin(); service != async_services_.end(); service++) { - if (!server->RegisterAsyncService(service->host.get(), service->service)) { + if (!server->RegisterAsyncService((*service)->host.get(), (*service)->service)) { return nullptr; } }