From adc4418bae54e51921cde937d96faebf576f6d0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Wed, 4 Jun 2025 23:22:40 +0200 Subject: [PATCH] std.fs.Dir.Iterator: Address a couple of alignment TODOs. --- lib/std/fs/Dir.zig | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/std/fs/Dir.zig b/lib/std/fs/Dir.zig index 806a09eb16..6075c8ca0f 100644 --- a/lib/std/fs/Dir.zig +++ b/lib/std/fs/Dir.zig @@ -24,7 +24,7 @@ pub const Iterator = switch (native_os) { .macos, .ios, .freebsd, .netbsd, .dragonfly, .openbsd, .solaris, .illumos => struct { dir: Dir, seek: i64, - buf: [1024]u8, // TODO align(@alignOf(posix.system.dirent)), + buf: [1024]u8 align(@alignOf(posix.system.dirent)), index: usize, end_index: usize, first_iter: bool, @@ -328,8 +328,6 @@ pub const Iterator = switch (native_os) { }, .linux => struct { dir: Dir, - // The if guard is solely there to prevent compile errors from missing `linux.dirent64` - // definition when compiling for other OSes. It doesn't do anything when compiling for Linux. buf: [1024]u8 align(@alignOf(linux.dirent64)), index: usize, end_index: usize, @@ -490,7 +488,7 @@ pub const Iterator = switch (native_os) { }, .wasi => struct { dir: Dir, - buf: [1024]u8, // TODO align(@alignOf(posix.wasi.dirent_t)), + buf: [1024]u8 align(@alignOf(std.os.wasi.dirent_t)), cookie: u64, index: usize, end_index: usize,