Clean up more WIN32 APIs

This commit is contained in:
Justine Tunney 2023-07-30 16:00:58 -07:00
parent 44b88d659d
commit 929478c524
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
60 changed files with 74 additions and 962 deletions

View file

@ -24,6 +24,7 @@
#include "libc/mem/mem.h"
#include "libc/nt/enum/fileflagandattributes.h"
#include "libc/nt/iphlpapi.h"
#include "libc/nt/thunk/msabi.h"
#include "libc/nt/winsock.h"
#include "libc/sock/internal.h"
#include "libc/sock/yoink.inc"
@ -35,6 +36,8 @@
#include "libc/sysv/consts/sock.h"
#include "libc/sysv/consts/sol.h"
__msabi extern typeof(__sys_setsockopt_nt) *const __imp_setsockopt;
/*
* ioctl(SIOCGIFCONFIG) for Windows need to access the following
* functions through weak reference. This ensure those symbols are not
@ -59,7 +62,7 @@ textwindows int sys_socket_nt(int family, int type, int protocol) {
// pydoc of this file third_party/python/Lib/test/support/__init__.py
// this needs to happen right after socket is called or it won't work
if (family == AF_INET || family == AF_INET6) {
unassert(__sys_setsockopt_nt(h, SOL_SOCKET, -5, &yes, 4) != -1);
unassert(__imp_setsockopt(h, SOL_SOCKET, -5, &yes, 4) != -1);
}
oflags = O_RDWR;