mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
renderer/opengl: comptime assertion to verify
This commit is contained in:
@ -64,6 +64,13 @@ pub const CellMode = enum(u8) {
|
||||
}
|
||||
|
||||
pub fn isFg(self: CellMode) bool {
|
||||
// Since we use bit tricks below, we want to ensure the enum
|
||||
// doesn't change without us looking at this logic again.
|
||||
comptime {
|
||||
const info = @typeInfo(CellMode).Enum;
|
||||
std.debug.assert(info.fields.len == 5);
|
||||
}
|
||||
|
||||
return @intFromEnum(self) & @intFromEnum(@as(CellMode, .fg)) != 0;
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user