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 std = @import("std");
|
||||||
const builtin = @import("builtin");
|
|
||||||
const assert = std.debug.assert;
|
const assert = std.debug.assert;
|
||||||
const apprt = @import("../apprt.zig");
|
const apprt = @import("../apprt.zig");
|
||||||
const configpkg = @import("../config.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.
|
// For ABI compatibility, we expect that this is our union size.
|
||||||
// At the time of writing, we don't promise ABI compatibility
|
// At the time of writing, we don't promise ABI compatibility
|
||||||
// so we can change this but I want to be aware of it.
|
// so we can change this but I want to be aware of it.
|
||||||
assert(@sizeOf(CValue) == switch (builtin.target.os.tag) {
|
assert(@sizeOf(CValue) == switch (@sizeOf(usize)) {
|
||||||
.windows => switch (builtin.target.cpu.arch) {
|
4 => 16,
|
||||||
.x86 => 16,
|
8 => 24,
|
||||||
else => 24,
|
else => unreachable,
|
||||||
},
|
|
||||||
else => 24,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user