mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-28 18:30:06 +00:00
Merge branch 'master' of https://github.com/odin-lang/Odin
This commit is contained in:
@@ -527,6 +527,7 @@ macos_release_map: map[string]Darwin_To_Release = {
|
||||
"23D60" = {{23, 3, 0}, "macOS", {"Sonoma", {14, 3, 1}}},
|
||||
"23E214" = {{23, 4, 0}, "macOS", {"Sonoma", {14, 4, 0}}},
|
||||
"23E224" = {{23, 4, 0}, "macOS", {"Sonoma", {14, 4, 1}}},
|
||||
"23F79" = {{23, 5, 0}, "macOS", {"Sonoma", {14, 5, 0}}},
|
||||
}
|
||||
|
||||
@(private)
|
||||
|
||||
@@ -487,6 +487,7 @@ connect :: proc "contextless" (sock: Fd, addr: ^$T) -> (Errno)
|
||||
where
|
||||
T == Sock_Addr_In ||
|
||||
T == Sock_Addr_In6 ||
|
||||
T == Sock_Addr_Un ||
|
||||
T == Sock_Addr_Any
|
||||
{
|
||||
ret := syscall(SYS_connect, sock, addr, size_of(T))
|
||||
@@ -502,6 +503,7 @@ accept :: proc "contextless" (sock: Fd, addr: ^$T, sockflags: Socket_FD_Flags =
|
||||
where
|
||||
T == Sock_Addr_In ||
|
||||
T == Sock_Addr_In6 ||
|
||||
T == Sock_Addr_Un ||
|
||||
T == Sock_Addr_Any
|
||||
{
|
||||
addr_len: i32 = size_of(T)
|
||||
@@ -514,6 +516,7 @@ recvfrom :: proc "contextless" (sock: Fd, buf: []u8, flags: Socket_Msg, addr: ^$
|
||||
where
|
||||
T == Sock_Addr_In ||
|
||||
T == Sock_Addr_In6 ||
|
||||
T == Sock_Addr_Un ||
|
||||
T == Sock_Addr_Any
|
||||
{
|
||||
addr_len: i32 = size_of(T)
|
||||
@@ -531,6 +534,7 @@ sendto :: proc "contextless" (sock: Fd, buf: []u8, flags: Socket_Msg, addr: ^$T)
|
||||
where
|
||||
T == Sock_Addr_In ||
|
||||
T == Sock_Addr_In6 ||
|
||||
T == Sock_Addr_Un ||
|
||||
T == Sock_Addr_Any
|
||||
{
|
||||
ret := syscall(SYS_sendto, sock, raw_data(buf), len(buf), transmute(i32) flags, addr, size_of(T))
|
||||
@@ -590,6 +594,7 @@ bind :: proc "contextless" (sock: Fd, addr: ^$T) -> (Errno)
|
||||
where
|
||||
T == Sock_Addr_In ||
|
||||
T == Sock_Addr_In6 ||
|
||||
T == Sock_Addr_Un ||
|
||||
T == Sock_Addr_Any
|
||||
{
|
||||
ret := syscall(SYS_bind, sock, addr, size_of(T))
|
||||
|
||||
@@ -631,6 +631,14 @@ Sock_Addr_In6 :: struct #packed {
|
||||
sin6_scope_id: u32,
|
||||
}
|
||||
|
||||
/*
|
||||
Struct representing Unix Domain Socket address
|
||||
*/
|
||||
Sock_Addr_Un :: struct #packed {
|
||||
sun_family: Address_Family,
|
||||
sun_path: [108]u8,
|
||||
}
|
||||
|
||||
/*
|
||||
Struct representing an arbitrary socket address.
|
||||
*/
|
||||
@@ -641,6 +649,7 @@ Sock_Addr_Any :: struct #raw_union {
|
||||
},
|
||||
using ipv4: Sock_Addr_In,
|
||||
using ipv6: Sock_Addr_In6,
|
||||
using uds: Sock_Addr_Un,
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -95,7 +95,7 @@ sem_t :: struct {
|
||||
PTHREAD_CANCEL_ENABLE :: 0
|
||||
PTHREAD_CANCEL_DISABLE :: 1
|
||||
PTHREAD_CANCEL_DEFERRED :: 0
|
||||
PTHREAD_CANCEL_ASYNCHRONOUS :: 1
|
||||
PTHREAD_CANCEL_ASYNCHRONOUS :: 2
|
||||
|
||||
foreign import "system:pthread"
|
||||
|
||||
@@ -119,4 +119,4 @@ foreign pthread {
|
||||
pthread_setcancelstate :: proc (state: c.int, old_state: ^c.int) -> c.int ---
|
||||
pthread_setcanceltype :: proc (type: c.int, old_type: ^c.int) -> c.int ---
|
||||
pthread_cancel :: proc (thread: pthread_t) -> c.int ---
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ sem_t :: distinct rawptr
|
||||
PTHREAD_CANCEL_ENABLE :: 0
|
||||
PTHREAD_CANCEL_DISABLE :: 1
|
||||
PTHREAD_CANCEL_DEFERRED :: 0
|
||||
PTHREAD_CANCEL_ASYNCHRONOUS :: 1
|
||||
PTHREAD_CANCEL_ASYNCHRONOUS :: 2
|
||||
|
||||
foreign import libc "system:c"
|
||||
|
||||
@@ -71,4 +71,4 @@ foreign libc {
|
||||
pthread_setcancelstate :: proc (state: c.int, old_state: ^c.int) -> c.int ---
|
||||
pthread_setcanceltype :: proc (type: c.int, old_type: ^c.int) -> c.int ---
|
||||
pthread_cancel :: proc (thread: pthread_t) -> c.int ---
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,4 +116,5 @@ foreign pthread {
|
||||
pthread_mutexattr_setpshared :: proc(attrs: ^pthread_mutexattr_t, value: c.int) -> c.int ---
|
||||
pthread_mutexattr_getpshared :: proc(attrs: ^pthread_mutexattr_t, result: ^c.int) -> c.int ---
|
||||
|
||||
pthread_testcancel :: proc () ---
|
||||
}
|
||||
|
||||
@@ -454,9 +454,9 @@ foreign kernel32 {
|
||||
// [MS-Docs](https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setfilecompletionnotificationmodes)
|
||||
SetFileCompletionNotificationModes :: proc(FileHandle: HANDLE, Flags: u8) -> BOOL ---
|
||||
// [MS-Docs](https://learn.microsoft.com/en-us/windows/win32/api/ioapiset/nf-ioapiset-createiocompletionport)
|
||||
CreateIoCompletionPort :: proc(FileHandle: HANDLE, ExistingCompletionPort: HANDLE, CompletionKey: ^uintptr, NumberOfConcurrentThreads: DWORD) -> HANDLE ---
|
||||
CreateIoCompletionPort :: proc(FileHandle: HANDLE, ExistingCompletionPort: HANDLE, CompletionKey: ULONG_PTR, NumberOfConcurrentThreads: DWORD) -> HANDLE ---
|
||||
//[MS-Docs](https://learn.microsoft.com/en-us/windows/win32/api/ioapiset/nf-ioapiset-getqueuedcompletionstatus)
|
||||
GetQueuedCompletionStatus :: proc(CompletionPort: HANDLE, lpNumberOfBytesTransferred: ^DWORD, lpCompletionKey: uintptr, lpOverlapped: ^^OVERLAPPED, dwMilliseconds: DWORD) -> BOOL ---
|
||||
GetQueuedCompletionStatus :: proc(CompletionPort: HANDLE, lpNumberOfBytesTransferred: ^DWORD, lpCompletionKey: PULONG_PTR, lpOverlapped: ^^OVERLAPPED, dwMilliseconds: DWORD) -> BOOL ---
|
||||
// [MS-Docs](https://learn.microsoft.com/en-us/windows/win32/api/ioapiset/nf-ioapiset-getqueuedcompletionstatusex)
|
||||
GetQueuedCompletionStatusEx :: proc(CompletionPort: HANDLE, lpCompletionPortEntries: ^OVERLAPPED_ENTRY, ulCount: c_ulong, ulNumEntriesRemoved: ^c_ulong, dwMilliseconds: DWORD, fAlertable: BOOL) -> BOOL ---
|
||||
// [MS-Docs](https://learn.microsoft.com/en-us/windows/win32/api/ioapiset/nf-ioapiset-postqueuedcompletionstatus)
|
||||
|
||||
Reference in New Issue
Block a user