Skip to content

Commit

Permalink
std.Build.Cache.Path: fix hash impl on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrk committed Jul 11, 2024
1 parent d7c59fd commit 42e252d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/std/Build/Cache/Path.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 42e252d

Please sign in to comment.