mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
std: make IntegerBitSet and ArrayBitSet have defined memory layout
This is useful for wrapping C libraries and native interfaces that make use of bit sets
This commit is contained in:
parent
67c4b16d6e
commit
e0a514df41
@ -50,7 +50,7 @@ pub fn StaticBitSet(comptime size: usize) type {
|
||||
/// This set is good for sets with a small size, but may generate
|
||||
/// inefficient code for larger sets, especially in debug mode.
|
||||
pub fn IntegerBitSet(comptime size: u16) type {
|
||||
return struct {
|
||||
return packed struct {
|
||||
const Self = @This();
|
||||
|
||||
// TODO: Make this a comptime field once those are fixed
|
||||
@ -287,7 +287,7 @@ pub fn ArrayBitSet(comptime MaskIntType: type, comptime size: usize) type {
|
||||
", which contains padding bits. Please round this up to an unpadded integer size (i.e. " ++ @typeName(FixedMaskType) ++ ").");
|
||||
}
|
||||
|
||||
return struct {
|
||||
return extern struct {
|
||||
const Self = @This();
|
||||
|
||||
// TODO: Make this a comptime field once those are fixed
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user