authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-05-26 12:08:15-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-05-27 20:56:48-07:00
logeb718ceffa0fd656a169a1dd2794e6e99bf5bcaa
tree2b53d2b444b6fd3edc5e874dacfd92024874eab6
parente8201734677ffcbe45dac12f2439f2de8e38710d

std.process: fix compilation on 32-bit targets


1 files changed, 18 insertions(+), 10 deletions(-)

lib/std/process.zig+18-10
...@@ -1836,11 +1836,15 @@ pub fn createEnvironFromMap(...@@ -1836,11 +1836,15 @@ pub fn createEnvironFromMap(
1836 break :a .nothing;1836 break :a .nothing;
1837 };1837 };
18381838
1839 const envp_count: usize = @intCast(@as(isize, map.count()) + @as(isize, switch (zig_progress_action) {1839 const envp_count: usize = c: {
1840 .add => 1,1840 var count: usize = map.count();
1841 .delete => -1,1841 switch (zig_progress_action) {
1842 .nothing, .edit => 0,1842 .add => count += 1,
1843 }));1843 .delete => count -= 1,
1844 .nothing, .edit => {},
1845 }
1846 break :c count;
1847 };
18441848
1845 const envp_buf = try arena.allocSentinel(?[*:0]u8, envp_count, null);1849 const envp_buf = try arena.allocSentinel(?[*:0]u8, envp_count, null);
1846 var i: usize = 0;1850 var i: usize = 0;
...@@ -1901,11 +1905,15 @@ pub fn createEnvironFromExisting(...@@ -1901,11 +1905,15 @@ pub fn createEnvironFromExisting(
1901 break :a .nothing;1905 break :a .nothing;
1902 };1906 };
19031907
1904 const envp_count: usize = @intCast(@as(isize, @intCast(existing_count)) + @as(isize, switch (zig_progress_action) {1908 const envp_count: usize = c: {
1905 .add => 1,1909 var count: usize = existing_count;
1906 .delete => -1,1910 switch (zig_progress_action) {
1907 .nothing, .edit => 0,1911 .add => count += 1,
1908 }));1912 .delete => count -= 1,
1913 .nothing, .edit => {},
1914 }
1915 break :c count;
1916 };
19091917
1910 const envp_buf = try arena.allocSentinel(?[*:0]u8, envp_count, null);1918 const envp_buf = try arena.allocSentinel(?[*:0]u8, envp_count, null);
1911 var i: usize = 0;1919 var i: usize = 0;