| ... | @@ -149,10 +149,10 @@ pub const Socket = struct { | ... | @@ -149,10 +149,10 @@ pub const Socket = struct { |
| 149 | /// Accept a pending incoming connection queued to the kernel backlog | 149 | /// Accept a pending incoming connection queued to the kernel backlog |
| 150 | /// of the socket. | 150 | /// of the socket. |
| 151 | pub fn accept(self: Socket, flags: u32) !Socket.Connection { | 151 | pub fn accept(self: Socket, flags: u32) !Socket.Connection { |
| 152 | var address: ws2_32.sockaddr = undefined; | 152 | var address: ws2_32.sockaddr_storage = undefined; |
| 153 | var address_len: c_int = @sizeOf(ws2_32.sockaddr); | 153 | var address_len: c_int = @sizeOf(ws2_32.sockaddr_storage); |
| 154 | | 154 | |
| 155 | const rc = ws2_32.accept(self.fd, &address, &address_len); | 155 | const rc = ws2_32.accept(self.fd, @ptrCast(*ws2_32.sockaddr, &address), &address_len); |
| 156 | if (rc == ws2_32.INVALID_SOCKET) { | 156 | if (rc == ws2_32.INVALID_SOCKET) { |
| 157 | return switch (ws2_32.WSAGetLastError()) { | 157 | return switch (ws2_32.WSAGetLastError()) { |
| 158 | .WSANOTINITIALISED => unreachable, | 158 | .WSANOTINITIALISED => unreachable, |
| ... | @@ -169,7 +169,7 @@ pub const Socket = struct { | ... | @@ -169,7 +169,7 @@ pub const Socket = struct { |
| 169 | } | 169 | } |
| 170 | | 170 | |
| 171 | const socket = Socket.from(rc); | 171 | const socket = Socket.from(rc); |
| 172 | const socket_address = Socket.Address.fromNative(@alignCast(4, &address)); | 172 | const socket_address = Socket.Address.fromNative(@alignCast(4, @ptrCast(*ws2_32.sockaddr, &address))); |
| 173 | | 173 | |
| 174 | return Socket.Connection.from(socket, socket_address); | 174 | return Socket.Connection.from(socket, socket_address); |
| 175 | } | 175 | } |