mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
better ABI check for apprt.Action.CValue
This commit is contained in:

committed by
Mitchell Hashimoto

parent
9583ea1b7a
commit
70a2a0afd5
@ -1,5 +1,4 @@
|
||||
const std = @import("std");
|
||||
const builtin = @import("builtin");
|
||||
const assert = std.debug.assert;
|
||||
const apprt = @import("../apprt.zig");
|
||||
const configpkg = @import("../config.zig");
|
||||
@ -364,12 +363,10 @@ pub const Action = union(Key) {
|
||||
// For ABI compatibility, we expect that this is our union size.
|
||||
// At the time of writing, we don't promise ABI compatibility
|
||||
// so we can change this but I want to be aware of it.
|
||||
assert(@sizeOf(CValue) == switch (builtin.target.os.tag) {
|
||||
.windows => switch (builtin.target.cpu.arch) {
|
||||
.x86 => 16,
|
||||
else => 24,
|
||||
},
|
||||
else => 24,
|
||||
assert(@sizeOf(CValue) == switch (@sizeOf(usize)) {
|
||||
4 => 16,
|
||||
8 => 24,
|
||||
else => unreachable,
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user