std: different mechanism for disabling network dependency

On Windows, it is sometimes problematic to depend on ws2_32.dll. Before,
users of std.Io.Threaded would have to call ioBasic() rather than io()
in order to avoid unnecessary dependencies on ws2_32.dll. Now, the
application can disable networking with std.Options.

This change is necessary due to moving networking functionality to
be based on Io.Operation, which is a tagged union.
This commit is contained in:
Andrew Kelley
2026-03-05 19:24:55 -08:00
parent 85ed81bb94
commit 80625990d5
40 changed files with 122 additions and 230 deletions
+3 -3
View File
@@ -11,7 +11,7 @@ fn foo() !void {
try std.Io.File.stdout().writeStreamingAll(io, "Hello, World!\n");
}
const std = @import("std");
const io = std.Io.Threaded.global_single_threaded.ioBasic();
const io = std.Io.Threaded.global_single_threaded.io();
#expect_stdout="Hello, World!\n"
#update=make function inline
@@ -23,7 +23,7 @@ inline fn foo() !void {
try std.Io.File.stdout().writeStreamingAll(io, "Hello, World!\n");
}
const std = @import("std");
const io = std.Io.Threaded.global_single_threaded.ioBasic();
const io = std.Io.Threaded.global_single_threaded.io();
#expect_stdout="Hello, World!\n"
#update=change string
@@ -35,5 +35,5 @@ inline fn foo() !void {
try std.Io.File.stdout().writeStreamingAll(io, "Hello, `inline` World!\n");
}
const std = @import("std");
const io = std.Io.Threaded.global_single_threaded.ioBasic();
const io = std.Io.Threaded.global_single_threaded.io();
#expect_stdout="Hello, `inline` World!\n"