aboutsummaryrefslogtreecommitdiff
path: root/core/sys/posix/sys_socket.odin
diff options
context:
space:
mode:
authorLaytan Laats <laytanlaats@hotmail.com>2024-10-20 18:38:37 +0200
committerLaytan <laytanlaats@hotmail.com>2024-10-28 18:59:06 +0100
commit1cebc025b0e1e0f7872d8a54f177e97a9a07f628 (patch)
tree57a02f23206e15f8284856ff61dc72fe133c7b54 /core/sys/posix/sys_socket.odin
parent9f609dd740f3c44d44fd377351c82edbe936911a (diff)
sys/posix: impl rest of linux, impl some of Windows
Diffstat (limited to 'core/sys/posix/sys_socket.odin')
-rw-r--r--core/sys/posix/sys_socket.odin10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/sys/posix/sys_socket.odin b/core/sys/posix/sys_socket.odin
index e613f0a10..3c9db5bfa 100644
--- a/core/sys/posix/sys_socket.odin
+++ b/core/sys/posix/sys_socket.odin
@@ -1,3 +1,4 @@
+#+build linux, darwin, netbsd, openbsd, freebsd
package posix
import "core:c"
@@ -325,14 +326,16 @@ when ODIN_OS == .Darwin || ODIN_OS == .FreeBSD || ODIN_OS == .NetBSD || ODIN_OS
socklen_t :: distinct c.uint
- _sa_family_t :: distinct c.uint8_t
-
when ODIN_OS == .Linux {
+ _sa_family_t :: distinct c.ushort
+
sockaddr :: struct {
sa_family: sa_family_t, /* [PSX] address family */
sa_data: [14]c.char, /* [PSX] socket address */
}
} else {
+ _sa_family_t :: distinct c.uint8_t
+
sockaddr :: struct {
sa_len: c.uint8_t, /* total length */
sa_family: sa_family_t, /* [PSX] address family */
@@ -560,7 +563,4 @@ when ODIN_OS == .Darwin || ODIN_OS == .FreeBSD || ODIN_OS == .NetBSD || ODIN_OS
SHUT_RDWR :: 2
SHUT_WR :: 1
-} else {
- #panic("posix is unimplemented for the current target")
}
-