Skip to content

Commit

Permalink
Compiler Warning: 'ns_returns_not_retained' attribute only applies to…
Browse files Browse the repository at this point in the history
… functions and methods booyah#39

NS_RETURNS_NOT_RETAINED not needed in version with ARC.
Fix booyah#39
  • Loading branch information
alexeyxo committed Mar 4, 2015
1 parent 3864591 commit 6b85cce
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/compiler/objc_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,8 @@ namespace google { namespace protobuf { namespace compiler {namespace objectivec
"value", *i);
}

printer->Print(
"#ifndef __has_feature\n"
" #define __has_feature(x) 0 // Compatibility with non-clang compilers.\n"
"#endif // __has_feature\n\n");

printer->Print(
"#ifndef NS_RETURNS_NOT_RETAINED\n"
" #if __has_feature(attribute_ns_returns_not_retained)\n"
" #define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained))\n"
" #else\n"
" #define NS_RETURNS_NOT_RETAINED\n"
" #endif\n"
"#endif\n\n");

printer->Print("\n\n");

// need to write out all enums first
for (int i = 0; i < file_->enum_type_count(); i++) {
Expand Down

0 comments on commit 6b85cce

Please sign in to comment.