5
5
6
6
use std:: ffi:: { CStr , CString } ;
7
7
use std:: fmt;
8
+ use std:: os:: raw:: { c_char, c_int, c_uint, c_void} ;
8
9
use std:: ptr;
9
10
use std:: str;
10
- use libc:: { c_char, c_int, c_uint, c_void, ptrdiff_t, size_t} ;
11
11
use malloc_buf:: MallocBuffer ;
12
12
13
13
use encode;
@@ -17,7 +17,7 @@ use {Encode, Encoding};
17
17
///
18
18
/// To convert an Objective-C `BOOL` into a Rust `bool`, compare it with `NO`.
19
19
#[ cfg( not( target_arch = "aarch64" ) ) ]
20
- pub type BOOL = :: libc :: c_schar ;
20
+ pub type BOOL = :: std :: os :: raw :: c_schar ;
21
21
/// The equivalent of true for Objective-C's `BOOL` type.
22
22
#[ cfg( not( target_arch = "aarch64" ) ) ]
23
23
pub const YES : BOOL = 1 ;
@@ -85,15 +85,15 @@ extern {
85
85
86
86
pub fn class_getName ( cls : * const Class ) -> * const c_char ;
87
87
pub fn class_getSuperclass ( cls : * const Class ) -> * const Class ;
88
- pub fn class_getInstanceSize ( cls : * const Class ) -> size_t ;
88
+ pub fn class_getInstanceSize ( cls : * const Class ) -> usize ;
89
89
pub fn class_getInstanceMethod ( cls : * const Class , sel : Sel ) -> * const Method ;
90
90
pub fn class_getInstanceVariable ( cls : * const Class , name : * const c_char ) -> * const Ivar ;
91
91
pub fn class_copyMethodList ( cls : * const Class , outCount : * mut c_uint ) -> * mut * const Method ;
92
92
pub fn class_copyIvarList ( cls : * const Class , outCount : * mut c_uint ) -> * mut * const Ivar ;
93
93
pub fn class_addMethod ( cls : * mut Class , name : Sel , imp : Imp , types : * const c_char ) -> BOOL ;
94
- pub fn class_addIvar ( cls : * mut Class , name : * const c_char , size : size_t , alignment : u8 , types : * const c_char ) -> BOOL ;
94
+ pub fn class_addIvar ( cls : * mut Class , name : * const c_char , size : usize , alignment : u8 , types : * const c_char ) -> BOOL ;
95
95
96
- pub fn objc_allocateClassPair ( superclass : * const Class , name : * const c_char , extraBytes : size_t ) -> * mut Class ;
96
+ pub fn objc_allocateClassPair ( superclass : * const Class , name : * const c_char , extraBytes : usize ) -> * mut Class ;
97
97
pub fn objc_disposeClassPair ( cls : * mut Class ) ;
98
98
pub fn objc_registerClassPair ( cls : * mut Class ) ;
99
99
@@ -104,7 +104,7 @@ extern {
104
104
pub fn objc_getClass ( name : * const c_char ) -> * const Class ;
105
105
106
106
pub fn ivar_getName ( ivar : * const Ivar ) -> * const c_char ;
107
- pub fn ivar_getOffset ( ivar : * const Ivar ) -> ptrdiff_t ;
107
+ pub fn ivar_getOffset ( ivar : * const Ivar ) -> isize ;
108
108
pub fn ivar_getTypeEncoding ( ivar : * const Ivar ) -> * const c_char ;
109
109
110
110
pub fn objc_msgSend ( obj : * mut Object , op : Sel , ...) -> * mut Object ;
0 commit comments