mirror of
https://github.com/ziglang/zig.git
synced 2026-02-20 08:14:48 +00:00
parent
751518787a
commit
e5956f23ca
@ -686,21 +686,41 @@ static int get_arch_pointer_bit_width(ZigLLVM_ArchType arch) {
|
||||
uint32_t target_c_type_size_in_bits(const ZigTarget *target, CIntType id) {
|
||||
switch (target->os) {
|
||||
case OsFreestanding:
|
||||
switch (id) {
|
||||
case CIntTypeShort:
|
||||
case CIntTypeUShort:
|
||||
return 16;
|
||||
case CIntTypeInt:
|
||||
case CIntTypeUInt:
|
||||
return 32;
|
||||
case CIntTypeLong:
|
||||
case CIntTypeULong:
|
||||
return get_arch_pointer_bit_width(target->arch.arch);
|
||||
case CIntTypeLongLong:
|
||||
case CIntTypeULongLong:
|
||||
return 64;
|
||||
case CIntTypeCount:
|
||||
zig_unreachable();
|
||||
switch (target->arch.arch) {
|
||||
case ZigLLVM_msp430:
|
||||
switch (id) {
|
||||
case CIntTypeShort:
|
||||
case CIntTypeUShort:
|
||||
return 16;
|
||||
case CIntTypeInt:
|
||||
case CIntTypeUInt:
|
||||
return 16;
|
||||
case CIntTypeLong:
|
||||
case CIntTypeULong:
|
||||
return get_arch_pointer_bit_width(target->arch.arch);
|
||||
case CIntTypeLongLong:
|
||||
case CIntTypeULongLong:
|
||||
return 64;
|
||||
case CIntTypeCount:
|
||||
zig_unreachable();
|
||||
}
|
||||
default:
|
||||
switch (id) {
|
||||
case CIntTypeShort:
|
||||
case CIntTypeUShort:
|
||||
return 16;
|
||||
case CIntTypeInt:
|
||||
case CIntTypeUInt:
|
||||
return 32;
|
||||
case CIntTypeLong:
|
||||
case CIntTypeULong:
|
||||
return get_arch_pointer_bit_width(target->arch.arch);
|
||||
case CIntTypeLongLong:
|
||||
case CIntTypeULongLong:
|
||||
return 64;
|
||||
case CIntTypeCount:
|
||||
zig_unreachable();
|
||||
}
|
||||
}
|
||||
case OsLinux:
|
||||
case OsMacOSX:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user