Skip to content

Commit

Permalink
修改 iOS 生成的 block 实现,放置重名编译错误
Browse files Browse the repository at this point in the history
  • Loading branch information
dhcdht committed Nov 12, 2024
1 parent 82522c8 commit 1ffd8d9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/Modules/objc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1588,7 +1588,7 @@ void OBJECTIVEC::emitProxyClassFunction(Node *n)
Printf(protocol_decl, "@required\n");
if (block_flag) {
Printv(block_decl, objcrettype, NIL);
Printf(block_decl, "(^%s)(", name);
Printf(block_decl, "(^%sBlock)(", name);
}

// Begin the first line of the function declaration
Expand All @@ -1605,7 +1605,7 @@ void OBJECTIVEC::emitProxyClassFunction(Node *n)
Printv(imcall, imfunctionname, "(", NIL);
Printv(protocol_defn, "return [_delegate ", proxyfunctionname, NIL);
if (block_flag) {
Printf(block_call, "return self.%s(", proxyfunctionname);
Printf(block_call, "return self.%sBlock(", proxyfunctionname);
}

// Attach the non-standard typemaps to the parameter list
Expand Down Expand Up @@ -1739,7 +1739,7 @@ void OBJECTIVEC::emitProxyClassFunction(Node *n)
substituteClassname(tm, type);

if (block_flag) {
Printf(protocol_impl, "if (self.%s) {\n", proxyfunctionname);
Printf(protocol_impl, "if (self.%sBlock) {\n", proxyfunctionname);
Printf(protocol_impl, "\t\t%s", block_call);
Printf(protocol_impl, "\t} else {\n");
Printf(protocol_impl, "\t\t%s\n", protocol_defn);
Expand Down

0 comments on commit 1ffd8d9

Please sign in to comment.