aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/compiler/objective_c_plugin.cc
diff options
context:
space:
mode:
authorGravatar Benjamin Herzog <pirat267@gmail.com>2016-04-18 18:10:14 +0200
committerGravatar Benjamin Herzog <pirat267@gmail.com>2016-04-18 18:10:14 +0200
commit208795c0fe7a2783c370adfa9b4ff3f73101961a (patch)
treefa7fe0b482be0d02623a09951c9ae446f670329c /src/compiler/objective_c_plugin.cc
parentc2b6a0bcf98fb3d153e319a4be255da8540977c8 (diff)
Added nullability to service declaration in objc
Diffstat (limited to 'src/compiler/objective_c_plugin.cc')
-rw-r--r--src/compiler/objective_c_plugin.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler/objective_c_plugin.cc b/src/compiler/objective_c_plugin.cc
index 17440358bb..f62faa5261 100644
--- a/src/compiler/objective_c_plugin.cc
+++ b/src/compiler/objective_c_plugin.cc
@@ -64,7 +64,8 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
".pbobjc.h\"\n\n"
"#import <ProtoRPC/ProtoService.h>\n"
"#import <RxLibrary/GRXWriteable.h>\n"
- "#import <RxLibrary/GRXWriter.h>\n";
+ "#import <RxLibrary/GRXWriter.h>\n\n"
+ "NS_ASSUME_NONNULL_BEGIN\n\n";
// TODO(jcanizales): Instead forward-declare the input and output types
// and import the files in the .pbrpc.m
@@ -81,8 +82,10 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
declarations += grpc_objective_c_generator::GetHeader(service);
}
+ ::grpc::string nonNullEnd = "\nNS_ASSUME_NONNULL_END\n";
+
Write(context, file_name + ".pbrpc.h",
- imports + '\n' + proto_imports + '\n' + declarations);
+ imports + '\n' + proto_imports + '\n' + declarations + nonNullEnd);
}
{