19-fix-unused-variable-cpp-gen.patch 1.0 KB

123456789101112131415161718192021
  1. diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc
  2. index 9b8ec0f..3baa5f3 100644
  3. --- a/src/compiler/cpp_generator.cc
  4. +++ b/src/compiler/cpp_generator.cc
  5. @@ -1972,6 +1972,7 @@ void PrintSourceService(grpc_generator::Printer* printer,
  6. printer->Print(*vars, "};\n\n");
  7. }
  8. + (*vars)["OptionsVariableName"] = service->method_count() ? "options" : "";
  9. printer->Print(*vars,
  10. "std::unique_ptr< $ns$$Service$::Stub> $ns$$Service$::NewStub("
  11. "const std::shared_ptr< ::grpc::ChannelInterface>& channel, "
  12. @@ -1984,7 +1985,7 @@ void PrintSourceService(grpc_generator::Printer* printer,
  13. printer->Print(*vars,
  14. "$ns$$Service$::Stub::Stub(const std::shared_ptr< "
  15. "::grpc::ChannelInterface>& channel, const "
  16. - "::grpc::StubOptions& options)\n");
  17. + "::grpc::StubOptions& $OptionsVariableName$)\n");
  18. printer->Indent();
  19. printer->Print(": channel_(channel)");
  20. for (int i = 0; i < service->method_count(); ++i) {