aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Goldberg <jens.goldberg@gmail.com>2021-05-24 09:13:25 +0000
committerAndrew Kelley <andrew@ziglang.org>2021-05-24 13:46:35 -0400
commit1df993706aaac77455bbd103c8abf88beaf74e6b (patch)
tree1b385fb8ed719a37b743605355273eb2efd0ecfe
parent0a99898b984c1ed98486060129ab441849118d8a (diff)
downloadzig-1df993706aaac77455bbd103c8abf88beaf74e6b.tar.gz
zig-1df993706aaac77455bbd103c8abf88beaf74e6b.zip
Fix socklen_t cast in win32 recvfrom
All other uses of `ws2_32.socklen_t` in windows.zig casts the value to an i32. `recvfrom` should do so as well; it currently errors out with `expected type '?*i32', found '?*u32'`.
-rw-r--r--lib/std/os/windows.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/std/os/windows.zig b/lib/std/os/windows.zig
index a01d35f210..4bdbe64fbf 100644
--- a/lib/std/os/windows.zig
+++ b/lib/std/os/windows.zig
@@ -1406,7 +1406,7 @@ pub fn recvfrom(s: ws2_32.SOCKET, buf: [*]u8, len: usize, flags: u32, from: ?*ws
var buffer = ws2_32.WSABUF{ .len = @truncate(u31, len), .buf = buf };
var bytes_received: DWORD = undefined;
var flags_inout = flags;
- if (ws2_32.WSARecvFrom(s, @ptrCast([*]ws2_32.WSABUF, &buffer), 1, &bytes_received, &flags_inout, from, from_len, null, null) == ws2_32.SOCKET_ERROR) {
+ if (ws2_32.WSARecvFrom(s, @ptrCast([*]ws2_32.WSABUF, &buffer), 1, &bytes_received, &flags_inout, from, @ptrCast(?*i32, from_len), null, null) == ws2_32.SOCKET_ERROR) {
return ws2_32.SOCKET_ERROR;
} else {
return @as(i32, @intCast(u31, bytes_received));