From: Andrew McGeachie Date: Tue, 27 Oct 2009 20:23:02 +0000 (+0000) Subject: THRIFT-521. Change @synthesize property declarations to @dynamic for happy compiling... X-Git-Tag: 0.2.0~19 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=72751724b5c1ff0397b8a35875cf3cb19f81ef64;p=common%2Fthrift.git THRIFT-521. Change @synthesize property declarations to @dynamic for happy compiling on OS X 10.6 as well as 10.5 git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@830326 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/compiler/cpp/src/generate/t_cocoa_generator.cc b/compiler/cpp/src/generate/t_cocoa_generator.cc index 9dadd2d9..e71f6ccc 100644 --- a/compiler/cpp/src/generate/t_cocoa_generator.cc +++ b/compiler/cpp/src/generate/t_cocoa_generator.cc @@ -173,7 +173,7 @@ class t_cocoa_generator : public t_oop_generator { std::string base_type_name(t_base_type* tbase); std::string declare_field(t_field* tfield); std::string declare_property(t_field* tfield); - std::string synthesize_property(t_field* tfield); + std::string dynamic_property(t_field* tfield); std::string function_signature(t_function* tfunction); std::string argument_list(t_struct* tstruct); std::string type_to_enum(t_type* ttype); @@ -574,11 +574,11 @@ void t_cocoa_generator::generate_cocoa_struct_implementation(ofstream &out, const vector& members = tstruct->get_members(); vector::const_iterator m_iter; - // synthesize properties + // @dynamic property declarations if (!members.empty()) { out << "#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)" << endl; for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) { - out << indent() << synthesize_property(*m_iter) << endl; + out << indent() << dynamic_property(*m_iter) << endl; } out << "#endif" << endl << endl; } @@ -2187,12 +2187,12 @@ string t_cocoa_generator::declare_property(t_field* tfield) { } /** - * Synthesizes an Objective-C 2.0 property. + * Add @dynamic declaration for an Objective-C 2.0 property. * - * @param tfield The field to synthesize a property for + * @param tfield The field for which to declare a dynamic property */ -string t_cocoa_generator::synthesize_property(t_field* tfield) { - return "@synthesize " + tfield->get_name() + ";"; +string t_cocoa_generator::dynamic_property(t_field* tfield) { + return "@dynamic " + tfield->get_name() + ";"; } /**