mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
33 lines
731 B
C
33 lines
731 B
C
module std::net::os;
|
|
|
|
$if env::os_is_win32():
|
|
|
|
const int PLATFORM_AF_INET = 1;
|
|
const int PLATFORM_AF_IPX = 6;
|
|
const int PLATFORM_AF_APPLETALK = 16;
|
|
const int PLATFORM_AF_NETBIOS = 17;
|
|
const int PLATFORM_AF_INET6 = 23;
|
|
const int PLATFORM_AF_IRDA = 26;
|
|
const int PLATFORM_AF_BTH = 32;
|
|
|
|
struct AddrInfo
|
|
{
|
|
int ai_flags;
|
|
int ai_family;
|
|
int ai_socktype;
|
|
int ai_protocol;
|
|
usz ai_addrlen;
|
|
char* ai_canonname;
|
|
void* ai_addr;
|
|
AddrInfo* ai_next;
|
|
}
|
|
|
|
typedef NativeSocket = distinct uptr;
|
|
|
|
extern fn int wsa_startup(int, void*) @extern("WSAStartup");
|
|
extern fn int ioctlsocket(NativeSocket, long cmd, ulong *argp);
|
|
extern fn int closesocket(NativeSocket);
|
|
|
|
macro NativeSocket.close(NativeSocket this) => closesocket(this);
|
|
|
|
$endif |