authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-10-19 06:58:23+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-10-19 06:58:23+02:00
logc0cc0f5991abbe2cadc769b2a87be105be681181
tree1dc78c3c43a12f2f8383fd64987c42f8401382ad
parentce95ea11132b0800959b4fe991cb9566f35143e4
signature Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.Target: fix cTypeBitSize() for ez80-freestanding

It was incorrectly using the generic prong. Just throw tios in the same OS prong as freestanding and ashetos.

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

lib/std/Target.zig+8-8
...@@ -3232,6 +3232,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 {...@@ -3232,6 +3232,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 {
3232 .freestanding,3232 .freestanding,
3233 .other,3233 .other,
3234 .ashetos,3234 .ashetos,
3235 .tios,
3235 => switch (target.cpu.arch) {3236 => switch (target.cpu.arch) {
3236 .msp430,3237 .msp430,
3237 .x86_16,3238 .x86_16,
...@@ -3254,6 +3255,13 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 {...@@ -3254,6 +3255,13 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 {
3254 .long, .ulong, .float => 32,3255 .long, .ulong, .float => 32,
3255 .double, .longdouble, .longlong, .ulonglong => 64,3256 .double, .longdouble, .longlong, .ulonglong => 64,
3256 },3257 },
3258 .ez80 => switch (c_type) {
3259 .char => 8,
3260 .short, .ushort => 16,
3261 .int, .uint => 24,
3262 .long, .ulong, .float, .double => 32,
3263 .longlong, .ulonglong, .longdouble => 64,
3264 },
3257 else => switch (c_type) {3265 else => switch (c_type) {
3258 .char => 8,3266 .char => 8,
3259 .short, .ushort => 16,3267 .short, .ushort => 16,
...@@ -3475,14 +3483,6 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 {...@@ -3475,14 +3483,6 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 {
3475 .longdouble => 80,3483 .longdouble => 80,
3476 },3484 },
34773485
3478 .tios => switch (c_type) {
3479 .char => 8,
3480 .short, .ushort => 16,
3481 .int, .uint => 24,
3482 .long, .ulong, .float, .double => 32,
3483 .longlong, .ulonglong, .longdouble => 64,
3484 },
3485
3486 .opengl => null,3486 .opengl => null,
3487 };3487 };
3488}3488}