Skip to content

Commit

Permalink
Move structs to s_no_extra_traits
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Jan 7, 2021
1 parent a39cf0d commit 66500ee
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions src/unix/linux_like/linux/align.rs
Expand Up @@ -52,27 +52,6 @@ macro_rules! expand_align {
pub fd: ::c_int,
pub pid: ::c_int,
}

// linux/can.h
#[repr(align(8))]
pub struct can_frame {
pub can_id: canid_t,
pub can_dlc: u8,
__pad: u8,
__res0: u8,
__res1: u8,
pub data: [u8; CAN_MAX_DLEN],
}

#[repr(align(8))]
pub struct canfd_frame {
pub can_id: canid_t,
pub len: u8,
pub flags: u8,
__res0: u8,
__res1: u8,
pub data: [u8; CANFD_MAX_DLEN],
}
}

s_no_extra_traits! {
Expand Down Expand Up @@ -137,6 +116,29 @@ macro_rules! expand_align {
pub struct pthread_rwlock_t {
size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
}

// linux/can.h
#[repr(align(8))]
#[allow(missing_debug_implementations)]
pub struct can_frame {
pub can_id: canid_t,
pub can_dlc: u8,
__pad: u8,
__res0: u8,
__res1: u8,
pub data: [u8; CAN_MAX_DLEN],
}

#[repr(align(8))]
#[allow(missing_debug_implementations)]
pub struct canfd_frame {
pub can_id: canid_t,
pub len: u8,
pub flags: u8,
__res0: u8,
__res1: u8,
pub data: [u8; CANFD_MAX_DLEN],
}
}
};
}

0 comments on commit 66500ee

Please sign in to comment.