From d8b15231616cd6aa475b3d899999ad267f213ac7 Mon Sep 17 00:00:00 2001 From: Carwyn Nelson Date: Wed, 10 Nov 2021 15:15:40 +0000 Subject: [PATCH] Fix the windows binding for getaddrinfo getaddrinfo should take a double pointer to ADDRINFOA instead of a single pointer. If you call the binding in its current state you will not get back a valid ADDRINFOA struct. I have also changed the `node` and `service` params to be cstring to avoid having to do `transmute(u8) value`. --- core/sys/windows/ws2_32.odin | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/sys/windows/ws2_32.odin b/core/sys/windows/ws2_32.odin index 6be55216e..cd467e142 100644 --- a/core/sys/windows/ws2_32.odin +++ b/core/sys/windows/ws2_32.odin @@ -76,10 +76,10 @@ foreign ws2_32 { listen :: proc(socket: SOCKET, backlog: c_int) -> c_int --- connect :: proc(socket: SOCKET, address: ^SOCKADDR, len: c_int) -> c_int --- getaddrinfo :: proc( - node: ^c_char, - service: ^c_char, + node: cstring, + service: cstring, hints: ^ADDRINFOA, - res: ^ADDRINFOA, + res: ^^ADDRINFOA, ) -> c_int --- freeaddrinfo :: proc(res: ^ADDRINFOA) --- select :: proc(