authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-10-19 06:53:37+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-10-20 10:02:39+02:00
logb7d2a8253bc90194bd92b0d2db4e197faf5fafae
treec1acd39ff876a6060946ff7c6a63e0b9c0297956
parent5d3ba332733c0729933cdc6919ba46ad58503f56
signature Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.Target: fix cTypeBitSize(.{long,ulong}) for plan9

They really made this choice *after* Microsoft's mistake.

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

lib/std/Target.zig+4-1
...@@ -3337,7 +3337,10 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 {...@@ -3337,7 +3337,10 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 {
3337 .char => 8,3337 .char => 8,
3338 .short, .ushort => 16,3338 .short, .ushort => 16,
3339 .int, .uint, .float => 32,3339 .int, .uint, .float => 32,
3340 .long, .ulong => target.ptrBitWidth(),3340 .long, .ulong => switch (target.os.tag) {
3341 .plan9 => 32, // This is certainly A Choice.
3342 else => target.ptrBitWidth(),
3343 },
3341 .longlong, .ulonglong, .double => 64,3344 .longlong, .ulonglong, .double => 64,
3342 .longdouble => switch (target.cpu.arch) {3345 .longdouble => switch (target.cpu.arch) {
3343 .x86,3346 .x86,