fix(ffi): use function pointer type for x86_64 objc_msgSend target#48
fix(ffi): use function pointer type for x86_64 objc_msgSend target#48skrtdev wants to merge 1 commit into
Conversation
Xcode 26 Clang rejects storing FFI_FN(...) in a void* before ffi_call. Use void (*)(void) to match ffi_call's second parameter signature. Fixes NativeScript#47 Co-authored-by: Cursor <cursoragent@cursor.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Fixes x86_64 iOS simulator builds on Xcode 26 by aligning the Objective-C objc_msgSend dispatch target type with libffi’s ffi_call function-pointer parameter.
Changes:
- In the
__x86_64__stret dispatch path, changestargetfromvoid*tovoid (*)(void)so it can be passed toffi_callwithout an invalid conversion. - Keeps arm64/non-x86_64 behavior unchanged while making x86_64 consistent with the existing
FFI_FN(...)usage.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixes #47
Problem
On Xcode 26, x86_64 simulator builds fail when compiling
NativeApiJsiInvocation.h:Solution
In the
__x86_64__stret dispatch path, change thetargetvariable fromvoid*tovoid (*)(void)so it matchesffi_call's second parameter and theFFI_FN()macro return type.The arm64 branch already passes
FFI_FN(...)directly; this aligns the x86_64 branch with the same typing without changing runtime behavior.Made with Cursor