You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
purego: support structs on Android and iOS
purego: support structs on Android and iOS
purego: support structs on Android and iOS
purego: support structs on Android and iOS
purego: support structs on Android and iOS
purego: support structs on Android and iOS (ebitengine#467)