Commit dd4ca88ca7

Andrew Kelley <andrew@ziglang.org>
2022-12-11 02:47:02
std: fix compile error bitrot
These were revealed in an earlier commit in this branch that removed a workaround disabling Windows std lib files from being tested.
1 parent d1ad126
Changed files (3)
lib/std/os/windows/ws2_32.zig
@@ -2344,6 +2344,6 @@ pub extern "ws2_32" fn getnameinfo(
     Flags: i32,
 ) callconv(WINAPI) i32;
 
-pub extern "IPHLPAPI" fn if_nametoindex(
+pub extern "iphlpapi" fn if_nametoindex(
     InterfaceName: [*:0]const u8,
 ) callconv(WINAPI) u32;
lib/std/os/windows.zig
@@ -1983,7 +1983,7 @@ pub fn loadWinsockExtensionFunction(comptime T: type, sock: ws2_32.SOCKET, guid:
         ws2_32.SIO_GET_EXTENSION_FUNCTION_POINTER,
         @ptrCast(*const anyopaque, &guid),
         @sizeOf(GUID),
-        &function,
+        @intToPtr(?*anyopaque, @ptrToInt(function)),
         @sizeOf(T),
         &num_bytes,
         null,
lib/std/x/os/socket_windows.zig
@@ -27,7 +27,7 @@ pub fn Mixin(comptime Socket: type) type {
                 return switch (ws2_32.WSAGetLastError()) {
                     .WSANOTINITIALISED => {
                         _ = try windows.WSAStartup(2, 2);
-                        return Socket.init(domain, socket_type, protocol, flags);
+                        return init(domain, socket_type, protocol, flags);
                     },
                     .WSAEAFNOSUPPORT => error.AddressFamilyNotSupported,
                     .WSAEMFILE => error.ProcessFdQuotaExceeded,