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) {
output += " @class " + one_class + ";\n";
output += "@class " + one_class + ";\n";
}
return output;

@ -118,11 +118,11 @@ 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) +
"\n" + forward_declarations + "\n" + kNonNullBegin + "\n" +
protocols + "\n" + PreprocIfNot(kProtocolOnly, interfaces) +
"\n" + kNonNullEnd + "\n");
class_declarations + "\n" +
PreprocIfNot(kForwardDeclare, class_imports) + "\n" +
forward_declarations + "\n" + kNonNullBegin + "\n" + protocols +
"\n" + PreprocIfNot(kProtocolOnly, interfaces) + "\n" +
kNonNullEnd + "\n");
}
{

Loading…
Cancel
Save