std: make all dirent structs extern

Using structs with unspecified layout on the ABI boundry can't end well.
This commit is contained in:
Isaac Freund 2024-06-15 22:20:20 +02:00
parent 254a3ba9d9
commit 687a756bf9
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11
2 changed files with 3 additions and 3 deletions

View File

@ -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,

View File

@ -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,