Skip to content

Commit

Permalink
Add proper cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
mu001999 committed Feb 28, 2024
1 parent ef32456 commit f36562e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions library/core/src/ptr/alignment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ type AlignmentEnum = AlignmentEnum32;
#[cfg(target_pointer_width = "64")]
type AlignmentEnum = AlignmentEnum64;

#[cfg(target_pointer_width = "16")]
#[derive(Copy, Clone, PartialEq, Eq)]
#[repr(u16)]
enum AlignmentEnum16 {
Expand All @@ -261,6 +262,7 @@ enum AlignmentEnum16 {
_Align1Shl15 = 1 << 15,
}

#[cfg(target_pointer_width = "32")]
#[derive(Copy, Clone, PartialEq, Eq)]
#[repr(u32)]
enum AlignmentEnum32 {
Expand Down Expand Up @@ -298,6 +300,7 @@ enum AlignmentEnum32 {
_Align1Shl31 = 1 << 31,
}

#[cfg(target_pointer_width = "64")]
#[derive(Copy, Clone, PartialEq, Eq)]
#[repr(u64)]
enum AlignmentEnum64 {
Expand Down

0 comments on commit f36562e

Please sign in to comment.