mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
std.c: fix return type of recv/recvfrom on windows
Windows defines `recv` and `recvfrom` to return a value of type `int`, rather than a pointer-sized signed integer, and so should use `c_int` rather than `isize` for their return types.
This commit is contained in:
parent
ff57a264ad
commit
3add9d8257
1 changed files with 7 additions and 2 deletions
|
|
@ -213,7 +213,12 @@ pub extern "c" fn sendto(
|
|||
) isize;
|
||||
pub extern "c" fn sendmsg(sockfd: c.fd_t, msg: *const c.msghdr_const, flags: u32) isize;
|
||||
|
||||
pub extern "c" fn recv(sockfd: c.fd_t, arg1: ?*anyopaque, arg2: usize, arg3: c_int) isize;
|
||||
pub extern "c" fn recv(
|
||||
sockfd: c.fd_t,
|
||||
arg1: ?*anyopaque,
|
||||
arg2: usize,
|
||||
arg3: c_int,
|
||||
) if (builtin.os.tag == .windows) c_int else isize;
|
||||
pub extern "c" fn recvfrom(
|
||||
sockfd: c.fd_t,
|
||||
noalias buf: *anyopaque,
|
||||
|
|
@ -221,7 +226,7 @@ pub extern "c" fn recvfrom(
|
|||
flags: u32,
|
||||
noalias src_addr: ?*c.sockaddr,
|
||||
noalias addrlen: ?*c.socklen_t,
|
||||
) isize;
|
||||
) if (builtin.os.tag == .windows) c_int else isize;
|
||||
pub extern "c" fn recvmsg(sockfd: c.fd_t, msg: *c.msghdr, flags: u32) isize;
|
||||
|
||||
pub extern "c" fn kill(pid: c.pid_t, sig: c_int) c_int;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue