Skip to content

Commit

Permalink
Use objc2::ffi::{NSInteger, NSUInteger}
Browse files Browse the repository at this point in the history
This now means that `NSInteger = isize` and `NSUInteger = usize`
  • Loading branch information
madsmtm committed Jun 16, 2022
1 parent 6d16668 commit 3ecd5e8
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions cocoa-foundation/src/foundation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,8 @@ use block::Block;
use libc;
use objc2_encode::{Encode, Encoding, RefEncode};

pub use objc2::ffi::{NSInteger, NSUInteger, NSIntegerMax};

#[cfg(target_pointer_width = "32")]
pub type NSInteger = libc::c_int;
#[cfg(target_pointer_width = "32")]
pub type NSUInteger = libc::c_uint;

#[cfg(target_pointer_width = "64")]
pub type NSInteger = libc::c_long;
#[cfg(target_pointer_width = "64")]
pub type NSUInteger = libc::c_ulong;

pub const NSIntegerMax: NSInteger = NSInteger::max_value();
pub const NSNotFound: NSInteger = NSIntegerMax;

const UTF8_ENCODING: usize = 4;
Expand Down

0 comments on commit 3ecd5e8

Please sign in to comment.