authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-02-02 23:14:08-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-02-02 23:14:08-05:00
logcd7713b1788aeeadf6c46def38d4ef4fa313fe75
tree3e83390acc9906167a117efc0804d0a7226d0d0e
parent0cf0739b0acee51fc7f3b0bb97a5c8c4199b0e44

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,7 +433,22 @@ static int get_arch_pointer_bit_width(ZigLLVM_ArchType arch) {
433int get_c_type_size_in_bits(const ZigTarget *target, CIntType id) {433int get_c_type_size_in_bits(const ZigTarget *target, CIntType id) {
434 switch (target->os) {434 switch (target->os) {
435 case ZigLLVM_UnknownOS: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 case ZigLLVM_Linux:452 case ZigLLVM_Linux:
438 case ZigLLVM_Darwin:453 case ZigLLVM_Darwin:
439 switch (id) {454 switch (id) {