From 687a756bf9b443ae53aa6dc3ee8f4a1550a09597 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Sat, 15 Jun 2024 22:20:20 +0200 Subject: [PATCH] std: make all dirent structs extern Using structs with unspecified layout on the ABI boundry can't end well. --- lib/std/c/emscripten.zig | 2 +- lib/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 index 501fcb4386b6e9c265ba4264e3486cd946291f12..0893289b14a7555511d9d8e713a2d1f75d0bfa49 100644 --- 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 index 1a3c6345150296769fd44fcba825cef4d80e8e99..07a59e8c0fa52199025c2e3ade522fe6ebf1d012 100644 --- 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, -- 2.54.0