| ... | @@ -1,12 +1,14 @@ | ... | @@ -1,12 +1,14 @@ |
| 1 | const std = @import("std"); | | |
| 2 | const builtin = @import("builtin"); | 1 | const builtin = @import("builtin"); |
| | 2 | const native_abi = builtin.abi; |
| | 3 | const native_arch = builtin.cpu.arch; |
| | 4 | const native_os = builtin.os.tag; |
| | 5 | const native_endian = builtin.cpu.arch.endian(); |
| | 6 | |
| | 7 | const std = @import("std"); |
| 3 | const c = @This(); | 8 | const c = @This(); |
| 4 | const maxInt = std.math.maxInt; | 9 | const maxInt = std.math.maxInt; |
| 5 | const assert = std.debug.assert; | 10 | const assert = std.debug.assert; |
| 6 | const page_size = std.heap.page_size_min; | 11 | const page_size = std.heap.page_size_min; |
| 7 | const native_abi = builtin.abi; | | |
| 8 | const native_arch = builtin.cpu.arch; | | |
| 9 | const native_os = builtin.os.tag; | | |
| 10 | const linux = std.os.linux; | 12 | const linux = std.os.linux; |
| 11 | const emscripten = std.os.emscripten; | 13 | const emscripten = std.os.emscripten; |
| 12 | const wasi = std.os.wasi; | 14 | const wasi = std.os.wasi; |
| ... | @@ -4118,9 +4120,13 @@ const posix_msghdr = extern struct { | ... | @@ -4118,9 +4120,13 @@ const posix_msghdr = extern struct { |
| 4118 | name: ?*sockaddr, | 4120 | name: ?*sockaddr, |
| 4119 | namelen: socklen_t, | 4121 | namelen: socklen_t, |
| 4120 | iov: [*]iovec, | 4122 | iov: [*]iovec, |
| | 4123 | pad0: if (@sizeOf(usize) == 8 and native_endian == .big) u32 else u0 = 0, |
| 4121 | iovlen: u32, | 4124 | iovlen: u32, |
| | 4125 | pad1: if (@sizeOf(usize) == 8 and native_endian == .little) u32 else u0 = 0, |
| 4122 | control: ?*anyopaque, | 4126 | control: ?*anyopaque, |
| | 4127 | pad2: if (@sizeOf(usize) == 8 and native_endian == .big) u32 else u0 = 0, |
| 4123 | controllen: socklen_t, | 4128 | controllen: socklen_t, |
| | 4129 | pad3: if (@sizeOf(usize) == 8 and native_endian == .little) u32 else u0 = 0, |
| 4124 | flags: u32, | 4130 | flags: u32, |
| 4125 | }; | 4131 | }; |
| 4126 | | 4132 | |
| ... | @@ -4148,9 +4154,13 @@ const posix_msghdr_const = extern struct { | ... | @@ -4148,9 +4154,13 @@ const posix_msghdr_const = extern struct { |
| 4148 | name: ?*const sockaddr, | 4154 | name: ?*const sockaddr, |
| 4149 | namelen: socklen_t, | 4155 | namelen: socklen_t, |
| 4150 | iov: [*]const iovec_const, | 4156 | iov: [*]const iovec_const, |
| | 4157 | pad0: if (@sizeOf(usize) == 8 and native_endian == .big) u32 else u0 = 0, |
| 4151 | iovlen: u32, | 4158 | iovlen: u32, |
| | 4159 | pad1: if (@sizeOf(usize) == 8 and native_endian == .little) u32 else u0 = 0, |
| 4152 | control: ?*const anyopaque, | 4160 | control: ?*const anyopaque, |
| | 4161 | pad2: if (@sizeOf(usize) == 8 and native_endian == .big) u32 else u0 = 0, |
| 4153 | controllen: socklen_t, | 4162 | controllen: socklen_t, |
| | 4163 | pad3: if (@sizeOf(usize) == 8 and native_endian == .little) u32 else u0 = 0, |
| 4154 | flags: u32, | 4164 | flags: u32, |
| 4155 | }; | 4165 | }; |
| 4156 | | 4166 | |
| ... | @@ -4193,7 +4203,9 @@ pub const cmsghdr = switch (native_os) { | ... | @@ -4193,7 +4203,9 @@ pub const cmsghdr = switch (native_os) { |
| 4193 | }; | 4203 | }; |
| 4194 | | 4204 | |
| 4195 | const posix_cmsghdr = extern struct { | 4205 | const posix_cmsghdr = extern struct { |
| | 4206 | pad0: if (@sizeOf(usize) == 8 and native_endian == .big) u32 else u0 = 0, |
| 4196 | len: socklen_t, | 4207 | len: socklen_t, |
| | 4208 | pad1: if (@sizeOf(usize) == 8 and native_endian == .little) u32 else u0 = 0, |
| 4197 | level: c_int, | 4209 | level: c_int, |
| 4198 | type: c_int, | 4210 | type: c_int, |
| 4199 | }; | 4211 | }; |