Merge pull request #14837 from nallohki/master

Makes @class forward decls unconditional in generated pbrpc.h files.
pull/14943/head
Muxi Yan 7 years ago committed by GitHub
commit 761d16eca1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/compiler/objective_c_generator.cc
  2. 10
      src/compiler/objective_c_plugin.cc

@ -206,7 +206,7 @@ void PrintMethodImplementations(Printer* printer,
} }
} }
for (auto one_class : classes) { for (auto one_class : classes) {
output += " @class " + one_class + ";\n"; output += "@class " + one_class + ";\n";
} }
return output; return output;

@ -118,11 +118,11 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
Write(context, file_name + ".pbrpc.h", Write(context, file_name + ".pbrpc.h",
PreprocIfNot(kForwardDeclare, imports) + "\n" + PreprocIfNot(kForwardDeclare, imports) + "\n" +
PreprocIfNot(kProtocolOnly, system_imports) + "\n" + PreprocIfNot(kProtocolOnly, system_imports) + "\n" +
PreprocIfElse(kForwardDeclare, class_declarations, class_declarations + "\n" +
class_imports) + PreprocIfNot(kForwardDeclare, class_imports) + "\n" +
"\n" + forward_declarations + "\n" + kNonNullBegin + "\n" + forward_declarations + "\n" + kNonNullBegin + "\n" + protocols +
protocols + "\n" + PreprocIfNot(kProtocolOnly, interfaces) + "\n" + PreprocIfNot(kProtocolOnly, interfaces) + "\n" +
"\n" + kNonNullEnd + "\n"); kNonNullEnd + "\n");
} }
{ {

Loading…
Cancel
Save