fix addrinfo struct def

Fixes #4816
This commit is contained in:
Laytan Laats
2025-02-12 19:24:27 +01:00
parent 4c4b481ccc
commit 55302280d8
3 changed files with 25 additions and 9 deletions
+22 -9
View File
@@ -352,15 +352,28 @@ when ODIN_OS == .Darwin || ODIN_OS == .FreeBSD || ODIN_OS == .NetBSD || ODIN_OS
// The highest reserved port number.
IPPORT_RESERVED :: 1024
addrinfo :: struct {
ai_flags: Addrinfo_Flags, /* [PSX] input flags */
ai_family: AF, /* [PSX] address family of socket */
ai_socktype: Sock, /* [PSX] socket type */
ai_protocol: Protocol, /* [PSX] protocol of socket */
ai_addrlen: socklen_t, /* [PSX] length of socket address */
ai_canonname: cstring, /* [PSX] canonical name of service location */
ai_addr: ^sockaddr, /* [PSX] binary address */
ai_next: ^addrinfo, /* [PSX] pointer to next in list */
when ODIN_OS == .Linux || ODIN_OS == .OpenBSD {
addrinfo :: struct {
ai_flags: Addrinfo_Flags, /* [PSX] input flags */
ai_family: AF, /* [PSX] address family of socket */
ai_socktype: Sock, /* [PSX] socket type */
ai_protocol: Protocol, /* [PSX] protocol of socket */
ai_addrlen: socklen_t, /* [PSX] length of socket address */
ai_addr: ^sockaddr, /* [PSX] binary address */
ai_canonname: cstring, /* [PSX] canonical name of service location */
ai_next: ^addrinfo, /* [PSX] pointer to next in list */
}
} else {
addrinfo :: struct {
ai_flags: Addrinfo_Flags, /* [PSX] input flags */
ai_family: AF, /* [PSX] address family of socket */
ai_socktype: Sock, /* [PSX] socket type */
ai_protocol: Protocol, /* [PSX] protocol of socket */
ai_addrlen: socklen_t, /* [PSX] length of socket address */
ai_canonname: cstring, /* [PSX] canonical name of service location */
ai_addr: ^sockaddr, /* [PSX] binary address */
ai_next: ^addrinfo, /* [PSX] pointer to next in list */
}
}
when ODIN_OS == .Darwin {