mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-27 19:09:47 +03:00
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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user