Skip to content

Commit

Permalink
Merge pull request SSheldon#12 from madsmtm/pointer-width-16
Browse files Browse the repository at this point in the history
Support architectures with pointer width 16
  • Loading branch information
madsmtm committed Aug 31, 2021
2 parents b697ca5 + cb2cb7b commit e846ef2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions objc_encode/src/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ encode_impls!(
);

unsafe impl Encode for isize {
#[cfg(target_pointer_width = "16")]
const ENCODING: Encoding<'static> = i16::ENCODING;

#[cfg(target_pointer_width = "32")]
const ENCODING: Encoding<'static> = i32::ENCODING;

Expand All @@ -48,6 +51,9 @@ unsafe impl Encode for isize {
}

unsafe impl Encode for usize {
#[cfg(target_pointer_width = "16")]
const ENCODING: Encoding<'static> = u16::ENCODING;

#[cfg(target_pointer_width = "32")]
const ENCODING: Encoding<'static> = u32::ENCODING;

Expand Down

0 comments on commit e846ef2

Please sign in to comment.