authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-07-10 17:27:30-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-07-12 00:14:08-07:00
logdad07fb6f33d9024dc6528ca3de37715fbc13182
treeffb2c06395e9239327ffdafb989b622274ee2055
parent2e429697865ebcadc001a7d167ef964b3f1393a2

std.Build.Cache.Path: fix hash impl on windows


1 files changed, 5 insertions(+), 1 deletions(-)

lib/std/Build/Cache/Path.zig+5-1
......@@ -183,7 +183,11 @@ pub const TableAdapter = struct {
183183
184184 pub fn hash(self: TableAdapter, a: Cache.Path) u32 {
185185 _ = self;
186 const seed: u32 = @bitCast(a.root_dir.handle.fd);
186 const seed = switch (@typeInfo(@TypeOf(a.root_dir.handle.fd))) {
187 .Pointer => @intFromPtr(a.root_dir.handle.fd),
188 .Int => @as(u32, @bitCast(a.root_dir.handle.fd)),
189 else => @compileError("unimplemented hash function"),
190 };
187191 return @truncate(Hash.hash(seed, a.sub_path));
188192 }
189193 pub fn eql(self: TableAdapter, a: Cache.Path, b: Cache.Path, b_index: usize) bool {