Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ffigen] Only use
objc_msgSend
variants on x64 (#836)
`objc_msgSend_stret` and `objc_msgSend_fpret` are only available on x64, so just use the normal `objc_msgSend` on arm64. We can only check the ABI at runtime, so for the stret and fpret variants we need to emit both the variant and the normal `objc_msgSend` function. Then we can decide which to use when the method is invoked at runtime. This runtime check is complicated by the fact that `objc_msgSend_stret` has a different signature than `objc_msgSend` has for the same method. This is because `objc_msgSend_stret` takes a pointer to the return type as its first arg. If it wasn't for this signature difference we could just change the function name string we pass to `DynamicLibrary.lookup`. Fixes #829
- Loading branch information