Refactor protocols.

This commit is contained in:
Christoffer Lerno
2023-10-06 20:29:20 +02:00
committed by Christoffer Lerno
parent f3e3aa231d
commit 99cfaa1583
98 changed files with 756 additions and 590 deletions

View File

@@ -1,15 +1,15 @@
module std::net::os;
const bool SUPPORTS_INET = env::LIBC && (env::WIN32 || env::DARWIN || env::LINUX);
def AIFamily = distinct CInt;
def AIProtocol = distinct CInt;
def AISockType = distinct CInt;
def AIFlags = distinct CInt;
distinct AIFamily = CInt;
distinct AIProtocol = CInt;
distinct AISockType = CInt;
distinct AIFlags = CInt;
def Socklen_t = CUInt @if(!env::WIN32);
def Socklen_t = usz @if(env::WIN32);
def SockAddrPtr = distinct void*;
distinct SockAddrPtr = void*;
struct AddrInfo
{

View File

@@ -4,7 +4,7 @@ import libc;
const int F_GETFL = 3;
const int F_SETFL = 4;
def NativeSocket = distinct inline Fd;
distinct NativeSocket = inline Fd;
struct Posix_pollfd
{

View File

@@ -13,7 +13,7 @@ const int FIONREAD = 1074030207;
const int FIONBIO = -2147195266;
const int FIOASYNC = -2147195267;
def NativeSocket = distinct uptr;
distinct NativeSocket = uptr;
extern fn CInt ioctlsocket(NativeSocket, CLong cmd, CULong *argp);
extern fn WSAError closesocket(NativeSocket);