diff options
| author | Isaac Freund <mail@isaacfreund.com> | 2024-06-15 22:20:20 +0200 |
|---|---|---|
| committer | Isaac Freund <mail@isaacfreund.com> | 2024-06-17 23:26:53 +0200 |
| commit | 687a756bf9b443ae53aa6dc3ee8f4a1550a09597 (patch) | |
| tree | 2bc99d8c9c5be770e39d5ac6229f372691338ccf /lib/std | |
| parent | 254a3ba9d963bd031d1e536d0da1ad0621121db2 (diff) | |
| download | zig-687a756bf9b443ae53aa6dc3ee8f4a1550a09597.tar.gz zig-687a756bf9b443ae53aa6dc3ee8f4a1550a09597.zip | |
std: make all dirent structs extern
Using structs with unspecified layout on the ABI boundry can't end well.
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/c/emscripten.zig | 2 | ||||
| -rw-r--r-- | lib/std/c/linux.zig | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/std/c/emscripten.zig b/lib/std/c/emscripten.zig index 501fcb4386..0893289b14 100644 --- a/lib/std/c/emscripten.zig +++ b/lib/std/c/emscripten.zig @@ -171,7 +171,7 @@ pub const RTLD = struct { pub const LOCAL = 0; }; -pub const dirent = struct { +pub const dirent = extern struct { ino: c_uint, off: c_uint, reclen: c_ushort, diff --git a/lib/std/c/linux.zig b/lib/std/c/linux.zig index 1a3c634515..07a59e8c0f 100644 --- a/lib/std/c/linux.zig +++ b/lib/std/c/linux.zig @@ -330,14 +330,14 @@ pub const RTLD = struct { pub const LOCAL = 0; }; -pub const dirent = struct { +pub const dirent = extern struct { ino: c_uint, off: c_uint, reclen: c_ushort, type: u8, name: [256]u8, }; -pub const dirent64 = struct { +pub const dirent64 = extern struct { ino: c_ulong, off: c_ulong, reclen: c_ushort, |
