| ... | ... | @@ -2884,19 +2884,29 @@ pub fn cTypeBitSize(target: Target, c_type: CType) u16 { |
| 2884 | 2884 | }, |
| 2885 | 2885 | }, |
| 2886 | 2886 | |
| 2887 | .elfiamcu, |
| 2888 | .fuchsia, |
| 2889 | .hermit, |
| 2890 | |
| 2891 | .aix, |
| 2892 | .haiku, |
| 2893 | .hurd, |
| 2887 | 2894 | .linux, |
| 2895 | .plan9, |
| 2896 | .rtems, |
| 2897 | .serenity, |
| 2898 | .zos, |
| 2899 | |
| 2888 | 2900 | .freebsd, |
| 2889 | | .netbsd, |
| 2890 | 2901 | .dragonfly, |
| 2902 | .netbsd, |
| 2891 | 2903 | .openbsd, |
| 2904 | |
| 2905 | .illumos, |
| 2906 | .solaris, |
| 2907 | |
| 2892 | 2908 | .wasi, |
| 2893 | 2909 | .emscripten, |
| 2894 | | .plan9, |
| 2895 | | .solaris, |
| 2896 | | .illumos, |
| 2897 | | .haiku, |
| 2898 | | .fuchsia, |
| 2899 | | .serenity, |
| 2900 | 2910 | => switch (target.cpu.arch) { |
| 2901 | 2911 | .msp430 => switch (c_type) { |
| 2902 | 2912 | .char => return 8, |
| ... | ... | @@ -2941,7 +2951,10 @@ pub fn cTypeBitSize(target: Target, c_type: CType) u16 { |
| 2941 | 2951 | .longdouble => switch (target.cpu.arch) { |
| 2942 | 2952 | .x86 => switch (target.abi) { |
| 2943 | 2953 | .android => return 64, |
| 2944 | | else => return 80, |
| 2954 | else => switch (target.os.tag) { |
| 2955 | .elfiamcu => return 64, |
| 2956 | else => return 80, |
| 2957 | }, |
| 2945 | 2958 | }, |
| 2946 | 2959 | |
| 2947 | 2960 | .powerpc, |
| ... | ... | @@ -2955,7 +2968,7 @@ pub fn cTypeBitSize(target: Target, c_type: CType) u16 { |
| 2955 | 2968 | .muslx32, |
| 2956 | 2969 | => return 64, |
| 2957 | 2970 | else => switch (target.os.tag) { |
| 2958 | | .freebsd, .netbsd, .openbsd => return 64, |
| 2971 | .aix, .freebsd, .netbsd, .openbsd => return 64, |
| 2959 | 2972 | else => return 128, |
| 2960 | 2973 | }, |
| 2961 | 2974 | }, |
| ... | ... | @@ -2971,7 +2984,7 @@ pub fn cTypeBitSize(target: Target, c_type: CType) u16 { |
| 2971 | 2984 | .muslx32, |
| 2972 | 2985 | => return 64, |
| 2973 | 2986 | else => switch (target.os.tag) { |
| 2974 | | .freebsd, .openbsd => return 64, |
| 2987 | .aix, .freebsd, .openbsd => return 64, |
| 2975 | 2988 | else => return 128, |
| 2976 | 2989 | }, |
| 2977 | 2990 | }, |
| ... | ... | @@ -3104,13 +3117,7 @@ pub fn cTypeBitSize(target: Target, c_type: CType) u16 { |
| 3104 | 3117 | }, |
| 3105 | 3118 | |
| 3106 | 3119 | .ps3, |
| 3107 | | .zos, |
| 3108 | | .rtems, |
| 3109 | | .aix, |
| 3110 | | .elfiamcu, |
| 3111 | 3120 | .contiki, |
| 3112 | | .hermit, |
| 3113 | | .hurd, |
| 3114 | 3121 | .opengl, |
| 3115 | 3122 | => @panic("TODO specify the C integer and float type sizes for this OS"), |
| 3116 | 3123 | } |
| ... | ... | @@ -3121,6 +3128,10 @@ pub fn cTypeAlignment(target: Target, c_type: CType) u16 { |
| 3121 | 3128 | switch (target.cpu.arch) { |
| 3122 | 3129 | .avr => return 1, |
| 3123 | 3130 | .x86 => switch (target.os.tag) { |
| 3131 | .elfiamcu => switch (c_type) { |
| 3132 | .longlong, .ulonglong, .double => return 4, |
| 3133 | else => {}, |
| 3134 | }, |
| 3124 | 3135 | .windows, .uefi => switch (c_type) { |
| 3125 | 3136 | .longlong, .ulonglong, .double => return 8, |
| 3126 | 3137 | .longdouble => switch (target.abi) { |
| ... | ... | @@ -3131,6 +3142,13 @@ pub fn cTypeAlignment(target: Target, c_type: CType) u16 { |
| 3131 | 3142 | }, |
| 3132 | 3143 | else => {}, |
| 3133 | 3144 | }, |
| 3145 | .powerpc, .powerpcle, .powerpc64, .powerpc64le => switch (target.os.tag) { |
| 3146 | .aix => switch (c_type) { |
| 3147 | .double, .longdouble => return 4, |
| 3148 | else => {}, |
| 3149 | }, |
| 3150 | else => {}, |
| 3151 | }, |
| 3134 | 3152 | else => {}, |
| 3135 | 3153 | } |
| 3136 | 3154 | |
| ... | ... | @@ -3244,6 +3262,10 @@ pub fn cTypePreferredAlignment(target: Target, c_type: CType) u16 { |
| 3244 | 3262 | }, |
| 3245 | 3263 | .avr => return 1, |
| 3246 | 3264 | .x86 => switch (target.os.tag) { |
| 3265 | .elfiamcu => switch (c_type) { |
| 3266 | .longlong, .ulonglong, .double, .longdouble => return 4, |
| 3267 | else => {}, |
| 3268 | }, |
| 3247 | 3269 | .windows, .uefi => switch (c_type) { |
| 3248 | 3270 | .longdouble => switch (target.abi) { |
| 3249 | 3271 | .gnu, .gnuilp32, .ilp32, .cygnus => return 4, |