diff options
| author | Laytan Laats <laytanlaats@hotmail.com> | 2025-02-12 19:24:27 +0100 |
|---|---|---|
| committer | Laytan Laats <laytanlaats@hotmail.com> | 2025-02-12 19:24:27 +0100 |
| commit | 55302280d8df902e766b56a18073e117ff6ccc3f (patch) | |
| tree | f4a54b68b51c7558f3ebd82ba7f32983887c2b91 /core/sys/posix | |
| parent | 4c4b481ccc0d6ff98e91801517b23ef78c624bdb (diff) | |
fix addrinfo struct def
Fixes #4816
Diffstat (limited to 'core/sys/posix')
| -rw-r--r-- | core/sys/posix/netdb.odin | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/core/sys/posix/netdb.odin b/core/sys/posix/netdb.odin index a8c83d83a..ff1cb9d4c 100644 --- a/core/sys/posix/netdb.odin +++ b/core/sys/posix/netdb.odin @@ -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 { |