Skip to content

Commit 687a756

Browse files
committed
std: make all dirent structs extern
Using structs with unspecified layout on the ABI boundry can't end well.
1 parent 254a3ba commit 687a756

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/std/c/emscripten.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ pub const RTLD = struct {
171171
pub const LOCAL = 0;
172172
};
173173

174-
pub const dirent = struct {
174+
pub const dirent = extern struct {
175175
ino: c_uint,
176176
off: c_uint,
177177
reclen: c_ushort,

lib/std/c/linux.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,14 +330,14 @@ pub const RTLD = struct {
330330
pub const LOCAL = 0;
331331
};
332332

333-
pub const dirent = struct {
333+
pub const dirent = extern struct {
334334
ino: c_uint,
335335
off: c_uint,
336336
reclen: c_ushort,
337337
type: u8,
338338
name: [256]u8,
339339
};
340-
pub const dirent64 = struct {
340+
pub const dirent64 = extern struct {
341341
ino: c_ulong,
342342
off: c_ulong,
343343
reclen: c_ushort,

0 commit comments

Comments
 (0)