authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-09-14 23:38:02+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-09-16 03:06:12+02:00
logc60a3bbdc11c10d4ee60e42d198ab11d8da03265
treeaa6dbaa2bae520a02fc72a40b9aa4de137827511
parent00a75075d3a20cb09053bc7ea0aeb83b988dfa95
signature Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.os.windows: use the peb() cbe workaround for all architectures like teb()


1 files changed, 6 insertions(+), 8 deletions(-)

lib/std/os/windows.zig+6-8
...@@ -3645,14 +3645,12 @@ pub fn teb() *TEB {...@@ -3645,14 +3645,12 @@ pub fn teb() *TEB {
3645}3645}
36463646
3647pub fn peb() *PEB {3647pub fn peb() *PEB {
3648 if (builtin.zig_backend == .stage2_c) switch (native_arch) {3648 if (builtin.zig_backend == .stage2_c) return @ptrCast(@alignCast(struct {
3649 .x86, .x86_64 => return @ptrCast(@alignCast(struct {3649 /// This is a workaround for the C backend until zig has the ability to put
3650 /// This is a workaround for the C backend until zig has the ability to put3650 /// C code in inline assembly.
3651 /// C code in inline assembly.3651 extern fn zig_windows_peb() callconv(.c) *anyopaque;
3652 extern fn zig_windows_peb() callconv(.c) *anyopaque;3652 }.zig_windows_peb()));
3653 }.zig_windows_peb())),3653 switch (native_arch) {
3654 else => {},
3655 } else switch (native_arch) {
3656 .aarch64 => {3654 .aarch64 => {
3657 comptime assert(@offsetOf(TEB, "ProcessEnvironmentBlock") == 0x60);3655 comptime assert(@offsetOf(TEB, "ProcessEnvironmentBlock") == 0x60);
3658 return asm (3656 return asm (