aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build/Cache
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-07-10 17:27:30 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-07-12 00:14:08 -0700
commitdad07fb6f33d9024dc6528ca3de37715fbc13182 (patch)
treeffb2c06395e9239327ffdafb989b622274ee2055 /lib/std/Build/Cache
parent2e429697865ebcadc001a7d167ef964b3f1393a2 (diff)
downloadzig-dad07fb6f33d9024dc6528ca3de37715fbc13182.tar.gz
zig-dad07fb6f33d9024dc6528ca3de37715fbc13182.zip
std.Build.Cache.Path: fix hash impl on windows
Diffstat (limited to 'lib/std/Build/Cache')
-rw-r--r--lib/std/Build/Cache/Path.zig6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/std/Build/Cache/Path.zig b/lib/std/Build/Cache/Path.zig
index c7160ea143..0abe79d373 100644
--- a/lib/std/Build/Cache/Path.zig
+++ b/lib/std/Build/Cache/Path.zig
@@ -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 {