pub fn cast(lc: LoadCommand, comptime Cmd: type) ?Cmd lc: LoadCommandCmd: type1944
1945
1946
1947
1948
1949
1950 pub fn cast(lc: LoadCommand, comptime Cmd: type) ?Cmd {
if (lc.data.len < @sizeOf(Cmd)) return null;
const ptr: *align(1) const Cmd = @ptrCast(lc.data.ptr);
var cmd = ptr.*;
if (builtin.cpu.arch.endian() != .little) std.mem.byteSwapAllFields(Cmd, &cmd);
return cmd;
}