aboutsummaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorKoakuma <koachan@protonmail.com>2021-05-13 06:18:51 +0700
committerKoakuma <koachan@protonmail.com>2021-05-13 06:18:51 +0700
commit90a54f06e507e11ccf07c1378fe4a12b002ec2bd (patch)
treee9ae9dca3d88062847e9679b7d1b045961f03931 /lib/std
parent9e67c062c40292f02334111a4784bd60907b5d0e (diff)
downloadzig-90a54f06e507e11ccf07c1378fe4a12b002ec2bd.tar.gz
zig-90a54f06e507e11ccf07c1378fe4a12b002ec2bd.zip
Add a comment to explain the alignment directive
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/fs.zig2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/std/fs.zig b/lib/std/fs.zig
index 1b77c6657a..02df5fae0f 100644
--- a/lib/std/fs.zig
+++ b/lib/std/fs.zig
@@ -501,6 +501,8 @@ pub const Dir = struct {
},
.linux => struct {
dir: Dir,
+ // The if guard is solely there to prevent compile errors from missing `os.linux.dirent64`
+ // definition when compiling for other OSes. It doesn't do anything when compiling for Linux.
buf: [8192]u8 align(if (builtin.os.tag != .linux) 1 else @alignOf(os.linux.dirent64)),
index: usize,
end_index: usize,