authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-10-22 04:20:52-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-10-29 06:20:51-07:00
loga3ddca36571993af4a575296292e17471890fc87
tree01630bc18bc9490cc722363108dfb5fb8caff9c6
parent2f260256903a5130e879ab7dc020fa160befc4d9

std.Io.Threaded: delete Windows implementation of if_nametoindex

Microsoft documentation says "The if_nametoindex function is implemented for portability of applications with Unix environments, but the ConvertInterface functions are preferred." This was also the only dependency on iphlpapi.

2 files changed, 1 insertions(+), 7 deletions(-)

lib/std/Io/Threaded.zig+1-3
......@@ -4000,9 +4000,7 @@ fn netInterfaceNameResolve(
40004000
40014001 if (native_os == .windows) {
40024002 try t.checkCancel();
4003 const index = ws2_32.if_nametoindex(&name.bytes);
4004 if (index == 0) return error.InterfaceNotFound;
4005 return .{ .index = index };
4003 @panic("TODO");
40064004 }
40074005
40084006 if (builtin.link_libc) {
lib/std/os/windows/ws2_32.zig-4
......@@ -2161,7 +2161,3 @@ pub extern "ws2_32" fn getnameinfo(
21612161 ServiceBufferName: u32,
21622162 Flags: i32,
21632163) callconv(.winapi) i32;
2164
2165pub extern "iphlpapi" fn if_nametoindex(
2166 InterfaceName: [*:0]const u8,
2167) callconv(.winapi) u32;