From 8827bc91eb1dbb6b30792c206085cb9a1a01b8a6 Mon Sep 17 00:00:00 2001 From: Tyson Roberts Date: Tue, 20 Mar 2018 17:44:47 +0900 Subject: [PATCH 1/4] Changes \#if forward_declare \#else \#end in .h files to \#if --- src/compiler/objective_c_plugin.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/objective_c_plugin.cc b/src/compiler/objective_c_plugin.cc index 76703d79cd8..25816819997 100644 --- a/src/compiler/objective_c_plugin.cc +++ b/src/compiler/objective_c_plugin.cc @@ -118,8 +118,8 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { Write(context, file_name + ".pbrpc.h", PreprocIfNot(kForwardDeclare, imports) + "\n" + PreprocIfNot(kProtocolOnly, system_imports) + "\n" + - PreprocIfElse(kForwardDeclare, class_declarations, - class_imports) + + class_declarations + "\n" + PreprocIfNot(kForwardDeclare, class_imports) + "\n" + forward_declarations + "\n" + kNonNullBegin + "\n" + protocols + "\n" + PreprocIfNot(kProtocolOnly, interfaces) + "\n" + kNonNullEnd + "\n"); From 7f5dcc9c1a2f9164204e42401104f92020422689 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Tue, 3 Apr 2018 13:59:56 -0700 Subject: [PATCH 2/4] Add missing '+' --- src/compiler/objective_c_plugin.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/objective_c_plugin.cc b/src/compiler/objective_c_plugin.cc index 25816819997..dbd3785e997 100644 --- a/src/compiler/objective_c_plugin.cc +++ b/src/compiler/objective_c_plugin.cc @@ -118,7 +118,7 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { Write(context, file_name + ".pbrpc.h", PreprocIfNot(kForwardDeclare, imports) + "\n" + PreprocIfNot(kProtocolOnly, system_imports) + "\n" + - class_declarations + "\n" + class_declarations + "\n" + PreprocIfNot(kForwardDeclare, class_imports) + "\n" + forward_declarations + "\n" + kNonNullBegin + "\n" + protocols + "\n" + PreprocIfNot(kProtocolOnly, interfaces) + From 3b33409e66d49a79fe4f598fc45e4c3edb2e7d37 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Tue, 3 Apr 2018 14:00:43 -0700 Subject: [PATCH 3/4] clang format --- src/compiler/objective_c_plugin.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/objective_c_plugin.cc b/src/compiler/objective_c_plugin.cc index dbd3785e997..f0fe3688cca 100644 --- a/src/compiler/objective_c_plugin.cc +++ b/src/compiler/objective_c_plugin.cc @@ -119,10 +119,10 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { PreprocIfNot(kForwardDeclare, imports) + "\n" + PreprocIfNot(kProtocolOnly, system_imports) + "\n" + class_declarations + "\n" + - PreprocIfNot(kForwardDeclare, class_imports) + - "\n" + forward_declarations + "\n" + kNonNullBegin + "\n" + - protocols + "\n" + PreprocIfNot(kProtocolOnly, interfaces) + - "\n" + kNonNullEnd + "\n"); + PreprocIfNot(kForwardDeclare, class_imports) + "\n" + + forward_declarations + "\n" + kNonNullBegin + "\n" + protocols + + "\n" + PreprocIfNot(kProtocolOnly, interfaces) + "\n" + + kNonNullEnd + "\n"); } { From 19ca19beed133f6db9c55376a5e431a610e00d28 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Wed, 4 Apr 2018 11:15:26 -0700 Subject: [PATCH 4/4] Fix indent --- src/compiler/objective_c_generator.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/objective_c_generator.cc b/src/compiler/objective_c_generator.cc index ffdeb8f6b07..39f68cb9565 100644 --- a/src/compiler/objective_c_generator.cc +++ b/src/compiler/objective_c_generator.cc @@ -206,7 +206,7 @@ void PrintMethodImplementations(Printer* printer, } } for (auto one_class : classes) { - output += " @class " + one_class + ";\n"; + output += "@class " + one_class + ";\n"; } return output;