Zig 0.17.0-dev (Split by item) This is an example of documentation generated by
ZigDoc , an alternative to Zig's built-in
Auto Doc feature. See also
examples in other modes/formats . The project being documented here (as the example) is the Zig standard library.
std › Target › cTypeByteSize Public Function cTypeByteSize Doc Source Public Function std.Target.cTypeByteSize
pub fn cTypeByteSize (t : *const Target , c_type : CType ) ?u16 Params File Target.zig: 3203
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225 pub fn cTypeByteSize (t : *const 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 ) orelse return null , 8 ),
.longdouble => switch (cTypeBitSize (t , c_type ) orelse return null ) {
64 => 8 ,
80 => @intCast (std .mem .alignForward (usize , 10 , cTypeAlignment (t , c_type ).?)),
128 => 16 ,
else => unreachable ,
},
};
}
Returns
nullif no C ABI is defined for this target.