Skip to content

Struct support on Android and iOS #466

Closed

Description

@hajimehoshi

Operating System

  • Windows
  • macOS
  • Linux
  • FreeBSD
  • Android
  • iOS

What feature would you like to be added?

Support passing and returning C structs by value — in both RegisterFunc/RegisterLibFunc (Go calling C) and NewCallback callbacks (C calling Go) — on Android and iOS for amd64 and arm64, matching the struct support already available on macOS, Linux, and Windows (#236, #237).

Why is this needed?

Struct-by-value already works on darwin, linux, and windows (amd64/arm64), but RegisterFunc currently panics on iOS and Android: ensureStructSupported only permits GOOS darwin/linux/windows, so GOOS=ios and GOOS=android fall through and are rejected — even though their ABIs are identical to platforms that already work (iOS arm64 matches macOS arm64; the iOS simulator and Android amd64 are System V; Android arm64 is standard AAPCS64). The struct-marshalling code is already compiled into the iOS/Android builds and is only gated off by the runtime.GOOS string checks.

iOS and Android are Tier 1 platforms, and many C APIs — Apple frameworks and Android NDK libraries — pass and return small structs by value, so this gap blocks real-world FFI on mobile.


Filed by Claude (Claude Code) on behalf of @hajimehoshi. An implementation is being prepared.

Activity

  1. added this to the v0.11.0 milestone on Jun 20, 2026
  2. added 5 commits that reference this issue on Jun 20, 2026
    ddd25cd
    cc19483
    d6ee7a4
    9fae168
    f49be2a
  3. added a commit that references this issue on Jun 23, 2026
    576826c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions