net: fix declarations of C.htonl/C.htons/C.ntohl/C.ntohs in aasocket.c.v

pull/12037/head
Delyan Angelov 2021-10-01 12:57:47 +03:00
parent 149517ced4
commit 2bdba5ed73
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
2 changed files with 4 additions and 6 deletions

View File

@ -33,9 +33,11 @@ fn C.socket(domain AddrFamily, typ SocketType, protocol int) int
// fn C.setsockopt(sockfd int, level int, optname int, optval voidptr, optlen C.socklen_t) int
fn C.setsockopt(sockfd int, level int, optname int, optval voidptr, optlen u32) int
fn C.htonl(hostlong u32) int
fn C.htonl(host u32) u32
fn C.htons(host u16) u16
fn C.htons(netshort u16) int
fn C.ntohl(net u32) u32
fn C.ntohs(net u16) u16
// fn C.bind(sockfd int, addr &C.sockaddr, addrlen C.socklen_t) int
// use voidptr for arg 2 becasue sockaddr is a generic descriptor for any kind of socket operation,
@ -68,8 +70,6 @@ fn C.recvfrom(sockfd int, buf voidptr, len usize, flags int, src_addr &Addr, add
fn C.shutdown(socket int, how int) int
fn C.ntohs(netshort u16) int
// fn C.getpeername(sockfd int, addr &C.sockaddr, addlen &C.socklen_t) int
fn C.getpeername(sockfd int, addr &Addr, addlen &u32) int

View File

@ -74,8 +74,6 @@ struct C.sockaddr_storage {
// fn C.shutdown() int
// fn C.ntohs() int
// fn C.getpeername() int
// fn C.inet_ntop(af int, src voidptr, dst charptr, dst_size int) charptr