From 70b2bfbceee3bbf6111fd55815b316cc503351d4 Mon Sep 17 00:00:00 2001 From: Tyson Roberts Date: Tue, 27 Feb 2018 15:17:02 +0900 Subject: Moved statics --- src/compiler/objective_c_plugin.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/compiler') diff --git a/src/compiler/objective_c_plugin.cc b/src/compiler/objective_c_plugin.cc index 16eba9a104..57aad8b391 100644 --- a/src/compiler/objective_c_plugin.cc +++ b/src/compiler/objective_c_plugin.cc @@ -107,14 +107,6 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { public: ObjectiveCGrpcGenerator() {} virtual ~ObjectiveCGrpcGenerator() {} - - private: - static const ::grpc::string kNonNullBegin = "NS_ASSUME_NONNULL_BEGIN\n"; - static const ::grpc::string kNonNullEnd = "NS_ASSUME_NONNULL_END\n"; - static const ::grpc::string kProtocolOnly = "GPB_GRPC_PROTOCOL_ONLY"; - static const ::grpc::string kForwardDeclare = - "GPB_GRPC_FORWARD_DECLARE_MESSAGE_PROTO"; - public: virtual bool Generate(const grpc::protobuf::FileDescriptor* file, const ::grpc::string& parameter, @@ -125,6 +117,12 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { return true; } + static const ::grpc::string kNonNullBegin = "NS_ASSUME_NONNULL_BEGIN\n"; + static const ::grpc::string kNonNullEnd = "NS_ASSUME_NONNULL_END\n"; + static const ::grpc::string kProtocolOnly = "GPB_GRPC_PROTOCOL_ONLY"; + static const ::grpc::string kForwardDeclare = + "GPB_GRPC_FORWARD_DECLARE_MESSAGE_PROTO"; + auto OmitIf = [](const ::grpc::string& s, const ::grpc::string& v) { return PreprocIf(s, v, kInvertCondition | kCheckIfDefined); }; -- cgit v1.2.3