mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-27 18:00:05 +00:00
more manual type carryover
This commit is contained in:
@@ -1518,6 +1518,7 @@ when ODIN_ARCH == .amd64 {
|
||||
#panic("Unsupported architecture")
|
||||
}
|
||||
|
||||
|
||||
// syscall related constants
|
||||
AT_FDCWD :: ~uintptr(99)
|
||||
AT_REMOVEDIR :: uintptr(0x200)
|
||||
@@ -2012,7 +2013,7 @@ sys_socket :: proc "contextless" (domain: int, type: int, protocol: int) -> int
|
||||
return int(intrinsics.syscall(unix.SYS_socket, uintptr(domain), uintptr(type), uintptr(protocol)))
|
||||
}
|
||||
|
||||
sys_connect :: proc "contextless" (sd: int, addr: rawptr, len: socklen_t) -> int {
|
||||
sys_connect :: proc "contextless" (sd: int, addr: rawptr, len: i32) -> int {
|
||||
return int(intrinsics.syscall(unix.SYS_connect, uintptr(sd), uintptr(addr), uintptr(len)))
|
||||
}
|
||||
|
||||
@@ -2024,11 +2025,11 @@ sys_listen :: proc "contextless" (sd: int, backlog: int) -> int {
|
||||
return int(intrinsics.syscall(unix.SYS_listen, uintptr(sd), uintptr(backlog)))
|
||||
}
|
||||
|
||||
sys_bind :: proc "contextless" (sd: int, addr: rawptr, len: socklen_t) -> int {
|
||||
sys_bind :: proc "contextless" (sd: int, addr: rawptr, len: i32) -> int {
|
||||
return int(intrinsics.syscall(unix.SYS_bind, uintptr(sd), uintptr(addr), uintptr(len)))
|
||||
}
|
||||
|
||||
sys_setsockopt :: proc "contextless" (sd: int, level: int, optname: int, optval: rawptr, optlen: socklen_t) -> int {
|
||||
sys_setsockopt :: proc "contextless" (sd: int, level: int, optname: int, optval: rawptr, optlen: i32) -> int {
|
||||
return int(intrinsics.syscall(unix.SYS_setsockopt, uintptr(sd), uintptr(level), uintptr(optname), uintptr(optval), uintptr(optlen)))
|
||||
}
|
||||
|
||||
@@ -2036,7 +2037,7 @@ sys_recvfrom :: proc "contextless" (sd: int, buf: rawptr, len: uint, flags: int,
|
||||
return i64(intrinsics.syscall(unix.SYS_recvfrom, uintptr(sd), uintptr(buf), uintptr(len), uintptr(flags), uintptr(addr), uintptr(alen)))
|
||||
}
|
||||
|
||||
sys_sendto :: proc "contextless" (sd: int, buf: rawptr, len: uint, flags: int, addr: rawptr, alen: socklen_t) -> i64 {
|
||||
sys_sendto :: proc "contextless" (sd: int, buf: rawptr, len: uint, flags: int, addr: rawptr, alen: i32) -> i64 {
|
||||
return i64(intrinsics.syscall(unix.SYS_sendto, uintptr(sd), uintptr(buf), uintptr(len), uintptr(flags), uintptr(addr), uintptr(alen)))
|
||||
}
|
||||
|
||||
|
||||
@@ -2425,6 +2425,27 @@ FILE_ATTRIBUTE_TAG_INFO :: struct {
|
||||
ReparseTag: DWORD,
|
||||
}
|
||||
|
||||
PADDRINFOEXW :: ^ADDRINFOEXW
|
||||
LPADDRINFOEXW :: ^ADDRINFOEXW
|
||||
ADDRINFOEXW :: struct {
|
||||
ai_flags: c_int,
|
||||
ai_family: c_int,
|
||||
ai_socktype: c_int,
|
||||
ai_protocol: c_int,
|
||||
ai_addrlen: size_t,
|
||||
ai_canonname: wstring,
|
||||
ai_addr: ^sockaddr,
|
||||
ai_blob: rawptr,
|
||||
ai_bloblen: size_t,
|
||||
ai_provider: LPGUID,
|
||||
ai_next: ^ADDRINFOEXW,
|
||||
}
|
||||
|
||||
LPLOOKUPSERVICE_COMPLETION_ROUTINE :: #type proc "stdcall" (
|
||||
dwErrorCode: DWORD,
|
||||
dwNumberOfBytesTransfered: DWORD,
|
||||
lpOverlapped: LPOVERLAPPED,
|
||||
)
|
||||
|
||||
|
||||
// https://docs.microsoft.com/en-gb/windows/win32/api/sysinfoapi/ns-sysinfoapi-system_info
|
||||
|
||||
Reference in New Issue
Block a user