Constructs a [*c] pointer with the const and volatile annotations from SelfType for pointing to a C flexible array of ElementType.
pub fn FlexibleArrayType(comptime SelfType: type, comptime ElementType: type) type
pub fn FlexibleArrayType(comptime SelfType: type, comptime ElementType: type) type {
switch (@typeInfo(SelfType)) {
.pointer => |ptr| {
return @Pointer(.c, .{
.@"const" = ptr.is_const,
.@"volatile" = ptr.is_volatile,
.@"allowzero" = true,
.@"addrspace" = .generic,
.@"align" = null,
}, ElementType, null);
},
else => |info| @compileError("Invalid self type \"" ++ @tagName(info) ++ "\" for flexible array getter: " ++ @typeName(SelfType)),
}
}