mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:24:33 +01:00
std.Build.Cache.Path: fix hash impl on windows
This commit is contained in:
parent
2e42969786
commit
dad07fb6f3
1 changed files with 5 additions and 1 deletions
|
|
@ -183,7 +183,11 @@ pub const TableAdapter = struct {
|
|||
|
||||
pub fn hash(self: TableAdapter, a: Cache.Path) u32 {
|
||||
_ = self;
|
||||
const seed: u32 = @bitCast(a.root_dir.handle.fd);
|
||||
const seed = switch (@typeInfo(@TypeOf(a.root_dir.handle.fd))) {
|
||||
.Pointer => @intFromPtr(a.root_dir.handle.fd),
|
||||
.Int => @as(u32, @bitCast(a.root_dir.handle.fd)),
|
||||
else => @compileError("unimplemented hash function"),
|
||||
};
|
||||
return @truncate(Hash.hash(seed, a.sub_path));
|
||||
}
|
||||
pub fn eql(self: TableAdapter, a: Cache.Path, b: Cache.Path, b_index: usize) bool {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue