make --target-os freestanding work
1 files changed, 16 insertions(+), 1 deletions(-)
src/target.cpp+16-1
| ... | ... | @@ -433,7 +433,22 @@ static int get_arch_pointer_bit_width(ZigLLVM_ArchType arch) { |
| 433 | 433 | int get_c_type_size_in_bits(const ZigTarget *target, CIntType id) { |
| 434 | 434 | switch (target->os) { |
| 435 | 435 | case ZigLLVM_UnknownOS: |
| 436 | | zig_unreachable(); |
| 436 | switch (id) { |
| 437 | case CIntTypeShort: |
| 438 | case CIntTypeUShort: |
| 439 | return 16; |
| 440 | case CIntTypeInt: |
| 441 | case CIntTypeUInt: |
| 442 | return 32; |
| 443 | case CIntTypeLong: |
| 444 | case CIntTypeULong: |
| 445 | return get_arch_pointer_bit_width(target->arch.arch); |
| 446 | case CIntTypeLongLong: |
| 447 | case CIntTypeULongLong: |
| 448 | return 64; |
| 449 | case CIntTypeCount: |
| 450 | zig_unreachable(); |
| 451 | } |
| 437 | 452 | case ZigLLVM_Linux: |
| 438 | 453 | case ZigLLVM_Darwin: |
| 439 | 454 | switch (id) { |