From cb2cb7b7b95b8d8047d96407c4f5c976952fc49d Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Tue, 1 Jun 2021 14:25:35 +0200 Subject: [PATCH] Support architectures with pointer width 16 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. --- src/encode.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/encode.rs b/src/encode.rs index cd592103f..d8ca69575 100644 --- a/src/encode.rs +++ b/src/encode.rs @@ -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; @@ -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;