fix os.sockaddr being a union instead of a struct

This commit is contained in:
Andrew Kelley 2019-10-30 20:57:20 -04:00
parent d7f15aa2cb
commit 7b7ba51642
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
5 changed files with 5 additions and 5 deletions

View File

@ -4,7 +4,7 @@ const mem = std.mem;
const testing = std.testing;
test "parse and render IPv6 addresses" {
const addr = net.IpAddress.parseIp6("FF01:0:0:0:0:0:0:FB", 80);
const addr = try net.IpAddress.parseIp6("FF01:0:0:0:0:0:0:FB", 80);
var buf: [100]u8 = undefined;
const printed = try std.fmt.bufPrint(&buf, "{}", addr);
std.testing.expect(mem.eql(u8, "[ff01::fb]:80", printed));

View File

@ -8,7 +8,7 @@ pub const pid_t = c_int;
pub const in_port_t = u16;
pub const sa_family_t = u8;
pub const socklen_t = u32;
pub const sockaddr = extern union {
pub const sockaddr = extern struct {
len: u8,
family: sa_family_t,
data: [14]u8,

View File

@ -137,7 +137,7 @@ pub const dirent = extern struct {
pub const in_port_t = u16;
pub const sa_family_t = u16;
pub const sockaddr = extern union {
pub const sockaddr = extern struct {
/// total length
len: u8,

View File

@ -809,7 +809,7 @@ pub const in_port_t = u16;
pub const sa_family_t = u16;
pub const socklen_t = u32;
pub const sockaddr = extern union {
pub const sockaddr = extern struct {
family: sa_family_t,
data: [14]u8,
};

View File

@ -133,7 +133,7 @@ pub const dirent = extern struct {
pub const in_port_t = u16;
pub const sa_family_t = u8;
pub const sockaddr = extern union {
pub const sockaddr = extern struct {
/// total length
len: u8,