diff options
Diffstat (limited to 'src/google/protobuf/compiler/objectivec/objectivec_file.cc')
-rw-r--r-- | src/google/protobuf/compiler/objectivec/objectivec_file.cc | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/google/protobuf/compiler/objectivec/objectivec_file.cc b/src/google/protobuf/compiler/objectivec/objectivec_file.cc index 1955c053..5a5c9e9b 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_file.cc +++ b/src/google/protobuf/compiler/objectivec/objectivec_file.cc @@ -117,10 +117,10 @@ void FileGenerator::GenerateHeader(io::Printer *printer) { printer->Print( "// @@protoc_insertion_point(imports)\n" + "\n" + "CF_EXTERN_C_BEGIN\n" "\n"); - printer->Print("CF_EXTERN_C_BEGIN\n\n"); - set<string> fwd_decls; for (vector<MessageGenerator *>::iterator iter = message_generators_.begin(); iter != message_generators_.end(); ++iter) { @@ -134,6 +134,10 @@ void FileGenerator::GenerateHeader(io::Printer *printer) { printer->Print("\n"); } + printer->Print( + "NS_ASSUME_NONNULL_BEGIN\n" + "\n"); + // need to write out all enums first for (vector<EnumGenerator *>::iterator iter = enum_generators_.begin(); iter != enum_generators_.end(); ++iter) { @@ -148,7 +152,6 @@ void FileGenerator::GenerateHeader(io::Printer *printer) { // For extensions to chain together, the Root gets created even if there // are no extensions. printer->Print( - "\n" "#pragma mark - $root_class_name$\n" "\n" "@interface $root_class_name$ : GPBRootObject\n" @@ -182,11 +185,12 @@ void FileGenerator::GenerateHeader(io::Printer *printer) { (*iter)->GenerateMessageHeader(printer); } - printer->Print("CF_EXTERN_C_END\n"); - printer->Print( - "\n" - "// @@protoc_insertion_point(global_scope)\n"); + "NS_ASSUME_NONNULL_END\n" + "\n" + "CF_EXTERN_C_END\n" + "\n" + "// @@protoc_insertion_point(global_scope)\n"); } void FileGenerator::GenerateSource(io::Printer *printer) { |