Skip to content

Commit

Permalink
add support of the default trait
Browse files Browse the repository at this point in the history
  • Loading branch information
stlankes committed Jan 29, 2024
1 parent f0ecc4e commit 7551b0f
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions hermit-abi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,27 +164,27 @@ pub type suseconds_t = i64;
pub type nfds_t = usize;

#[repr(C)]
#[derive(Debug, Copy, Clone)]
#[derive(Debug, Default, Copy, Clone)]
pub struct in_addr {
pub s_addr: u32,
}

#[repr(C)]
#[derive(Debug, Copy, Clone)]
#[derive(Debug, Default, Copy, Clone)]
pub struct in6_addr {
pub s6_addr: [u8; 16],
}

#[repr(C)]
#[derive(Debug, Copy, Clone)]
#[derive(Debug, Default, Copy, Clone)]
pub struct sockaddr {
pub sa_len: u8,
pub sa_family: sa_family_t,
pub sa_data: [u8; 14],
}

#[repr(C)]
#[derive(Debug, Copy, Clone)]
#[derive(Debug, Default, Copy, Clone)]
pub struct sockaddr_in {
pub sin_len: u8,
pub sin_family: sa_family_t,
Expand All @@ -194,7 +194,7 @@ pub struct sockaddr_in {
}

#[repr(C)]
#[derive(Debug, Copy, Clone)]
#[derive(Debug, Default, Copy, Clone)]
pub struct sockaddr_in6 {
pub sin6_family: sa_family_t,
pub sin6_port: u16,
Expand All @@ -217,7 +217,7 @@ pub struct addrinfo {
}

#[repr(C)]
#[derive(Debug, Copy, Clone)]
#[derive(Debug, Default, Copy, Clone)]
pub struct sockaddr_storage {
pub s2_len: u8,
pub ss_family: sa_family_t,
Expand All @@ -226,35 +226,35 @@ pub struct sockaddr_storage {
}

#[repr(C)]
#[derive(Debug, Copy, Clone)]
#[derive(Debug, Default, Copy, Clone)]
pub struct ip_mreq {
pub imr_multiaddr: in_addr,
pub imr_interface: in_addr,
}

#[repr(C)]
#[derive(Debug, Copy, Clone)]
#[derive(Debug, Default, Copy, Clone)]
pub struct ipv6_mreq {
pub ipv6mr_multiaddr: in6_addr,
pub ipv6mr_interface: u32,
}

#[repr(C)]
#[derive(Debug, Copy, Clone)]
#[derive(Debug, Default, Copy, Clone)]
pub struct linger {
pub l_onoff: i32,
pub l_linger: i32,
}

#[repr(C)]
#[derive(Debug, Copy, Clone)]
#[derive(Debug, Default, Copy, Clone)]
pub struct timeval {
pub tv_sec: time_t,
pub tv_usec: suseconds_t,
}

#[repr(C)]
#[derive(Debug, Copy, Clone)]
#[derive(Debug, Default, Copy, Clone)]
pub struct pollfd {
/// file descriptor
pub fd: i32,
Expand Down Expand Up @@ -296,7 +296,7 @@ pub struct stat {
}

#[repr(C)]
#[derive(Debug, Clone, Copy)]
#[derive(Debug, Default, Clone, Copy)]
pub struct dirent64 {
/// 64-bit inode number
pub d_ino: u64,
Expand Down

0 comments on commit 7551b0f

Please sign in to comment.