zig

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

commit 687a756bf9b443ae53aa6dc3ee8f4a1550a09597 (tree)
parent 254a3ba9d963bd031d1e536d0da1ad0621121db2
Author: Isaac Freund <mail@isaacfreund.com>
Date:   Sat, 15 Jun 2024 22:20:20 +0200

std: make all dirent structs extern

Using structs with unspecified layout on the ABI boundry can't end well.

Diffstat:
Mlib/std/c/emscripten.zig | 2+-
Mlib/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 @@ -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 @@ -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,