Commit 687a756bf9

Isaac Freund <mail@isaacfreund.com>
2024-06-15 22:20:20
std: make all dirent structs extern
Using structs with unspecified layout on the ABI boundry can't end well.
1 parent 254a3ba
Changed files (2)
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,
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,