Function cTypeByteSize [src]
Prototype
pub fn cTypeByteSize(t: Target, c_type: CType) u16
Parameters
t: Target
c_type: CType
Source
pub fn cTypeByteSize(t: Target, c_type: CType) u16 {
return switch (c_type) {
.char,
.short,
.ushort,
.int,
.uint,
.long,
.ulong,
.longlong,
.ulonglong,
.float,
.double,
=> @divExact(cTypeBitSize(t, c_type), 8),
.longdouble => switch (cTypeBitSize(t, c_type)) {
16 => 2,
32 => 4,
64 => 8,
80 => @intCast(std.mem.alignForward(usize, 10, cTypeAlignment(t, .longdouble))),
128 => 16,
else => unreachable,
},
};
}