aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/grpc/patches/19-fix-unused-variable-cpp-gen.patch
blob: 4967b47c3aab22cccec1dc17851cfdac768f3b6e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc
index 9b8ec0f..3baa5f3 100644
--- a/src/compiler/cpp_generator.cc
+++ b/src/compiler/cpp_generator.cc
@@ -1972,6 +1972,7 @@ void PrintSourceService(grpc_generator::Printer* printer,
     printer->Print(*vars, "};\n\n");
   }

+  (*vars)["OptionsVariableName"] = service->method_count() ? "options" : "";
   printer->Print(*vars,
                  "std::unique_ptr< $ns$$Service$::Stub> $ns$$Service$::NewStub("
                  "const std::shared_ptr< ::grpc::ChannelInterface>& channel, "
@@ -1984,7 +1985,7 @@ void PrintSourceService(grpc_generator::Printer* printer,
   printer->Print(*vars,
                  "$ns$$Service$::Stub::Stub(const std::shared_ptr< "
                  "::grpc::ChannelInterface>& channel, const "
-                 "::grpc::StubOptions& options)\n");
+                 "::grpc::StubOptions& $OptionsVariableName$)\n");
   printer->Indent();
   printer->Print(": channel_(channel)");
   for (int i = 0; i < service->method_count(); ++i) {