diff options
| author | Tristan Ross <tristan.ross@midstall.com> | 2024-01-21 21:38:08 -0800 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-01-22 10:53:27 -0800 |
| commit | d0da3d731e40fe9e0b45d50d4c3bf8210b44d472 (patch) | |
| tree | 3cf117d8843c72440b063570d598d89335f55254 /src | |
| parent | b0c8a3f31631a63bca3a2feece38e57b9a1c5060 (diff) | |
| download | zig-d0da3d731e40fe9e0b45d50d4c3bf8210b44d472.tar.gz zig-d0da3d731e40fe9e0b45d50d4c3bf8210b44d472.zip | |
std.io: replace readStructBig with readStructEndian
Diffstat (limited to 'src')
| -rw-r--r-- | src/link/MachO/fat.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/link/MachO/fat.zig b/src/link/MachO/fat.zig index bc896704b8..fcaca7d99a 100644 --- a/src/link/MachO/fat.zig +++ b/src/link/MachO/fat.zig @@ -1,6 +1,6 @@ pub fn isFatLibrary(file: std.fs.File) bool { const reader = file.reader(); - const hdr = reader.readStructBig(macho.fat_header) catch return false; + const hdr = reader.readStructEndian(macho.fat_header, .big) catch return false; defer file.seekTo(0) catch {}; return hdr.magic == macho.FAT_MAGIC; } @@ -13,7 +13,7 @@ pub const Arch = struct { /// Caller owns the memory. pub fn parseArchs(gpa: Allocator, file: std.fs.File) ![]const Arch { const reader = file.reader(); - const fat_header = try reader.readStructBig(macho.fat_header); + const fat_header = try reader.readStructEndian(macho.fat_header, .big); assert(fat_header.magic == macho.FAT_MAGIC); var archs = try std.ArrayList(Arch).initCapacity(gpa, fat_header.nfat_arch); @@ -21,7 +21,7 @@ pub fn parseArchs(gpa: Allocator, file: std.fs.File) ![]const Arch { var fat_arch_index: u32 = 0; while (fat_arch_index < fat_header.nfat_arch) : (fat_arch_index += 1) { - const fat_arch = try reader.readStructBig(macho.fat_arch); + const fat_arch = try reader.readStructEndian(macho.fat_arch, .big); // If we come across an architecture that we do not know how to handle, that's // fine because we can keep looking for one that might match. const arch: std.Target.Cpu.Arch = switch (fat_arch.cputype) { |
