From ae919915f6c3c1827311ebc6ec3c5883a1cec08e Mon Sep 17 00:00:00 2001 From: Krzysztof Wolicki Date: Sun, 7 Jul 2024 12:10:19 +0200 Subject: [PATCH 1/4] std.Build.Cache.Path: fix makeOpenPath signature --- lib/std/Build/Cache/Path.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/Build/Cache/Path.zig b/lib/std/Build/Cache/Path.zig index 27dd15184b..d7266da9b0 100644 --- a/lib/std/Build/Cache/Path.zig +++ b/lib/std/Build/Cache/Path.zig @@ -58,7 +58,7 @@ pub fn openFile( return p.root_dir.handle.openFile(joined_path, flags); } -pub fn makeOpenPath(p: Path, sub_path: []const u8, opts: fs.OpenDirOptions) !fs.Dir { +pub fn makeOpenPath(p: Path, sub_path: []const u8, opts: fs.Dir.OpenDirOptions) !fs.Dir { var buf: [fs.max_path_bytes]u8 = undefined; const joined_path = if (p.sub_path.len == 0) sub_path else p: { break :p std.fmt.bufPrint(&buf, "{s}" ++ fs.path.sep_str ++ "{s}", .{ From 64e84a452b043599e96e1e6af895b9959628f1fe Mon Sep 17 00:00:00 2001 From: Krzysztof Wolicki Date: Sun, 7 Jul 2024 12:13:07 +0200 Subject: [PATCH 2/4] std.ArrayHashMap: unmanaged holds the pointer stability lock --- lib/std/array_hash_map.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/array_hash_map.zig b/lib/std/array_hash_map.zig index ba086f8764..c82c553370 100644 --- a/lib/std/array_hash_map.zig +++ b/lib/std/array_hash_map.zig @@ -427,7 +427,7 @@ pub fn ArrayHashMap( /// Set the map to an empty state, making deinitialization a no-op, and /// returning a copy of the original. pub fn move(self: *Self) Self { - self.pointer_stability.assertUnlocked(); + self.unmanaged.pointer_stability.assertUnlocked(); const result = self.*; self.unmanaged = .{}; return result; From 815022c87b34bae92d98475685425063ca36cbf7 Mon Sep 17 00:00:00 2001 From: Krzysztof Wolicki Date: Sun, 7 Jul 2024 12:16:14 +0200 Subject: [PATCH 3/4] std.coff: fix setAlignment --- lib/std/coff.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/coff.zig b/lib/std/coff.zig index 1461ac7fbc..211b1a1819 100644 --- a/lib/std/coff.zig +++ b/lib/std/coff.zig @@ -542,7 +542,7 @@ pub const SectionHeader = extern struct { pub fn setAlignment(self: *SectionHeader, new_alignment: u16) void { assert(new_alignment > 0 and new_alignment <= 8192); - self.flags.ALIGN = std.math.log2(new_alignment); + self.flags.ALIGN = @intCast(std.math.log2(new_alignment)); } pub fn isCode(self: SectionHeader) bool { From 7205756a69b2fb8641e02d23592ac12206f98052 Mon Sep 17 00:00:00 2001 From: Krzysztof Wolicki Date: Sun, 7 Jul 2024 12:28:28 +0200 Subject: [PATCH 4/4] Step.TranslateC: fix defineCMacro --- lib/std/Build/Step/TranslateC.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/Build/Step/TranslateC.zig b/lib/std/Build/Step/TranslateC.zig index e07744c2da..d7c62ed194 100644 --- a/lib/std/Build/Step/TranslateC.zig +++ b/lib/std/Build/Step/TranslateC.zig @@ -107,7 +107,7 @@ pub fn addCheckFile(translate_c: *TranslateC, expected_matches: []const []const /// If the value is omitted, it is set to 1. /// `name` and `value` need not live longer than the function call. pub fn defineCMacro(translate_c: *TranslateC, name: []const u8, value: ?[]const u8) void { - const macro = std.Build.constructranslate_cMacro(translate_c.step.owner.allocator, name, value); + const macro = translate_c.step.owner.fmt("{s}={s}", .{ name, value orelse "1" }); translate_c.c_macros.append(macro) catch @panic("OOM"); }