From ba0e3be5cfa2f60f2f9d2a4eb319408f972796c2 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 10 Mar 2020 15:27:45 -0400 Subject: (breaking) rework stream abstractions The main goal here is to make the function pointers comptime, so that we don't have to do the crazy stuff with async function frames. Since InStream, OutStream, and SeekableStream are already generic across error sets, it's not really worse to make them generic across the vtable as well. See #764 for the open issue acknowledging that using generics for these abstractions is a design flaw. See #130 for the efforts to make these abstractions non-generic. This commit also changes the OutStream API so that `write` returns number of bytes written, and `writeAll` is the one that loops until the whole buffer is written. --- src-self-hosted/libc_installation.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src-self-hosted/libc_installation.zig') diff --git a/src-self-hosted/libc_installation.zig b/src-self-hosted/libc_installation.zig index 41def38126..78aafeff28 100644 --- a/src-self-hosted/libc_installation.zig +++ b/src-self-hosted/libc_installation.zig @@ -38,7 +38,7 @@ pub const LibCInstallation = struct { pub fn parse( allocator: *Allocator, libc_file: []const u8, - stderr: *std.io.OutStream(fs.File.WriteError), + stderr: var, ) !LibCInstallation { var self: LibCInstallation = .{}; @@ -123,7 +123,7 @@ pub const LibCInstallation = struct { return self; } - pub fn render(self: LibCInstallation, out: *std.io.OutStream(fs.File.WriteError)) !void { + pub fn render(self: LibCInstallation, out: var) !void { @setEvalBranchQuota(4000); const include_dir = self.include_dir orelse ""; const sys_include_dir = self.sys_include_dir orelse ""; -- cgit v1.2.3