From 7251eb1681d269ef5672193a608b580e371981fb Mon Sep 17 00:00:00 2001 From: Jonathan Marler Date: Tue, 17 Mar 2020 01:28:20 -0600 Subject: [PATCH] fix a couple sockfds to be fd_t rather than i32 Using i32 causes compile errors on Windows because it uses *c_void rather than i32 for it's fd_t type. --- lib/std/os.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/std/os.zig b/lib/std/os.zig index 377f7d707..3333a9178 100644 --- a/lib/std/os.zig +++ b/lib/std/os.zig @@ -2184,7 +2184,7 @@ const ListenError = error{ OperationNotSupported, } || UnexpectedError; -pub fn listen(sockfd: i32, backlog: u32) ListenError!void { +pub fn listen(sockfd: fd_t, backlog: u32) ListenError!void { const rc = system.listen(sockfd, backlog); switch (errno(rc)) { 0 => return, @@ -2475,7 +2475,7 @@ pub fn connect(sockfd: fd_t, sock_addr: *const sockaddr, len: socklen_t) Connect } } -pub fn getsockoptError(sockfd: i32) ConnectError!void { +pub fn getsockoptError(sockfd: fd_t) ConnectError!void { var err_code: u32 = undefined; var size: u32 = @sizeOf(u32); const rc = system.getsockopt(sockfd, SOL_SOCKET, SO_ERROR, @ptrCast([*]u8, &err_code), &size);