zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 5a4cc24c0eef08260e26c914828fc960aaa5631b (tree)
parent f8dd4b13d6fe428265229fc1e31c2f8b0cd373b1
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Tue, 31 Aug 2021 18:37:04 -0700

std: dirent is not part of posix

Diffstat:
Mlib/std/fs.zig | 8++++----
Mlib/std/os.zig | 1-
2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/lib/std/fs.zig b/lib/std/fs.zig @@ -304,7 +304,7 @@ pub const Dir = struct { .macos, .ios, .freebsd, .netbsd, .dragonfly, .openbsd => struct { dir: Dir, seek: i64, - buf: [8192]u8, // TODO align(@alignOf(os.dirent)), + buf: [8192]u8, // TODO align(@alignOf(os.system.dirent)), index: usize, end_index: usize, @@ -344,7 +344,7 @@ pub const Dir = struct { self.index = 0; self.end_index = @intCast(usize, rc); } - const darwin_entry = @ptrCast(*align(1) os.dirent, &self.buf[self.index]); + const darwin_entry = @ptrCast(*align(1) os.system.dirent, &self.buf[self.index]); const next_index = self.index + darwin_entry.reclen(); self.index = next_index; @@ -391,7 +391,7 @@ pub const Dir = struct { self.index = 0; self.end_index = @intCast(usize, rc); } - const bsd_entry = @ptrCast(*align(1) os.dirent, &self.buf[self.index]); + const bsd_entry = @ptrCast(*align(1) os.system.dirent, &self.buf[self.index]); const next_index = self.index + bsd_entry.reclen(); self.index = next_index; @@ -462,7 +462,7 @@ pub const Dir = struct { self.index = 0; self.end_index = @intCast(usize, rc); } - const haiku_entry = @ptrCast(*align(1) os.dirent, &self.buf[self.index]); + const haiku_entry = @ptrCast(*align(1) os.system.dirent, &self.buf[self.index]); const next_index = self.index + haiku_entry.reclen(); self.index = next_index; const name = mem.spanZ(@ptrCast([*:0]u8, &haiku_entry.d_name)); diff --git a/lib/std/os.zig b/lib/std/os.zig @@ -123,7 +123,6 @@ pub const blksize_t = system.blksize_t; pub const clock_t = system.clock_t; pub const cpu_set_t = system.cpu_set_t; pub const dev_t = system.dev_t; -pub const dirent = system.dirent; pub const dl_phdr_info = system.dl_phdr_info; pub const empty_sigset = system.empty_sigset; pub const fd_t = system.fd_t;