Skip to content

fix(ffi): use function pointer type for x86_64 objc_msgSend target#48

Open
skrtdev wants to merge 1 commit into
NativeScript:mainfrom
skrtdev:fix/x86-64-ffi-call-target-type
Open

fix(ffi): use function pointer type for x86_64 objc_msgSend target#48
skrtdev wants to merge 1 commit into
NativeScript:mainfrom
skrtdev:fix/x86-64-ffi-call-target-type

Conversation

@skrtdev

@skrtdev skrtdev commented Jul 24, 2026

Copy link
Copy Markdown

Fixes #47

Problem

On Xcode 26, x86_64 simulator builds fail when compiling NativeApiJsiInvocation.h:

error: cannot initialize a variable of type 'void *' with an rvalue of type 'void (*)()'
error: no matching function for call to 'ffi_call'

Solution

In the __x86_64__ stret dispatch path, change the target variable from void* to void (*)(void) so it matches ffi_call's second parameter and the FFI_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

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>
Copilot AI review requested due to automatic review settings July 24, 2026 13:56
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 665e7b0f-044a-499c-9068-f09e822f1a8f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, changes target from void* to void (*)(void) so it can be passed to ffi_call without 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ios): x86_64 simulator build fails on Xcode 26 due to ffi_call target type mismatch

2 participants