authorgravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2024-06-15 22:20:20+02:00
committergravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2024-06-17 23:26:53+02:00
log687a756bf9b443ae53aa6dc3ee8f4a1550a09597
tree2bc99d8c9c5be770e39d5ac6229f372691338ccf
parent254a3ba9d963bd031d1e536d0da1ad0621121db2
signaturelock-open Commit is signed but in an unrecognized format.

std: make all dirent structs extern

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

2 files changed, 3 insertions(+), 3 deletions(-)

lib/std/c/emscripten.zig+1-1
...@@ -171,7 +171,7 @@ pub const RTLD = struct {...@@ -171,7 +171,7 @@ pub const RTLD = struct {
171 pub const LOCAL = 0;171 pub const LOCAL = 0;
172};172};
173173
174pub const dirent = struct {174pub const dirent = extern struct {
175 ino: c_uint,175 ino: c_uint,
176 off: c_uint,176 off: c_uint,
177 reclen: c_ushort,177 reclen: c_ushort,
lib/std/c/linux.zig+2-2
...@@ -330,14 +330,14 @@ pub const RTLD = struct {...@@ -330,14 +330,14 @@ pub const RTLD = struct {
330 pub const LOCAL = 0;330 pub const LOCAL = 0;
331};331};
332332
333pub const dirent = struct {333pub const dirent = extern struct {
334 ino: c_uint,334 ino: c_uint,
335 off: c_uint,335 off: c_uint,
336 reclen: c_ushort,336 reclen: c_ushort,
337 type: u8,337 type: u8,
338 name: [256]u8,338 name: [256]u8,
339};339};
340pub const dirent64 = struct {340pub const dirent64 = extern struct {
341 ino: c_ulong,341 ino: c_ulong,
342 off: c_ulong,342 off: c_ulong,
343 reclen: c_ushort,343 reclen: c_ushort,