-
Notifications
You must be signed in to change notification settings - Fork 107
C abi compatability #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
A-abi
Area: ABI handling
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
help wanted
Extra attention is needed
Milestone
Comments
This comment has been minimized.
This comment has been minimized.
It needs to be stored at a certain stack offset. |
Found another problem: use std::os::raw::*;
#[repr(C)]
pub struct Sel {
ptr: *const c_void,
}
extern {
pub fn sel_registerName(name: *const c_char) -> Sel;
}
pub unsafe fn call_register_name(res: &mut Sel) {
*res = sel_registerName(0 as *const _)
} Uses a return pointer to return Expected: playground::call_register_name:
pushq %rbx
movq %rdi, %rbx
xorl %edi, %edi
callq *sel_registerName@GOTPCREL(%rip)
movq %rax, (%rbx)
popq %rbx
retq This causes the objc crate to misbehave. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-abi
Area: ABI handling
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
help wanted
Extra attention is needed
!
Option<fn(..)>
layout.abi = Abi::ByValPair
(3f15b0a)Abi::ScalarPair
+ non rust abisAbi::ByRef
values. (ptr or stack offset)The text was updated successfully, but these errors were encountered: