Skip to content

Commit

Permalink
Support architectures with pointer width 16
Browse files Browse the repository at this point in the history
I know, no Apple devices support this, but there might be someone out there using GNUstep on devices with pointer width 16, and we might as well support those.
  • Loading branch information
madsmtm committed Jun 1, 2021
1 parent 0f2c404 commit cb2cb7b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions 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 cb2cb7b

Please sign in to comment.