Mark all C functions as extern "C"
Closed this issue · 2 comments
npmccallum commented
I missed this in my first pass. All the C functions that we override or export need to be marked as extern "C"
. For example:
#[no_mangle]
pub fn accept(fd: c_int, addr: *mut libc::sockaddr, addr_len: *mut libc::socklen_t) -> c_int {
accept4(fd, addr, addr_len, 0)
}
Needs to become:
#[no_mangle]
pub extern "C" fn accept(fd: c_int, addr: *mut libc::sockaddr, addr_len: *mut libc::socklen_t) -> c_int {
accept4(fd, addr, addr_len, 0)
}
DK-DARKmatter commented
Do we need to reorganize the function declaration since we have a format width limitation?
frozencemetery commented
That would be nice, yes. Ideally rustfmt
gets run in CI, but there's no CI on this project yet.