Reduce usage of libc crate.
Switch from using `libc` types to `::std::os::raw`. This is a breaking change due to the differences in how `c_void` is defined. `core-foundation-sys` no longer needs the `libc` dependency.
This commit is contained in:
@@ -9,7 +9,6 @@ license = "MIT / Apache-2.0"
|
||||
build = "build.rs"
|
||||
|
||||
[dependencies]
|
||||
libc = "0.2"
|
||||
|
||||
[features]
|
||||
mac_os_10_7_support = [] # backwards compatibility
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use libc::c_void;
|
||||
use std::os::raw::c_void;
|
||||
|
||||
use base::{CFRange, CFIndex, CFAllocatorRef, CFTypeID, Boolean};
|
||||
use string::CFStringRef;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// except according to those terms.
|
||||
|
||||
use std::cmp::Ordering;
|
||||
use libc::{c_uint, c_long, c_ulong, c_void, c_int};
|
||||
use std::os::raw::{c_uint, c_long, c_ulong, c_void, c_int};
|
||||
use string::CFStringRef;
|
||||
|
||||
pub type Boolean = u8;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use libc::c_void;
|
||||
use std::os::raw::c_void;
|
||||
|
||||
use base::{CFTypeID, CFAllocatorRef};
|
||||
use url::CFURLRef;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use libc::c_void;
|
||||
use std::os::raw::c_void;
|
||||
|
||||
use base::{CFAllocatorRef, CFTypeID, CFIndex};
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use libc::c_void;
|
||||
use std::os::raw::c_void;
|
||||
|
||||
use base::{CFAllocatorRef, CFComparisonResult, CFTypeID};
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use libc::{c_void};
|
||||
use std::os::raw::c_void;
|
||||
|
||||
use base::{CFAllocatorRef, CFHashCode, CFIndex, CFTypeID, Boolean};
|
||||
use string::CFStringRef;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use libc::c_void;
|
||||
use std::os::raw::c_void;
|
||||
|
||||
use base::{CFTypeID, CFIndex};
|
||||
use string::CFStringRef;
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use libc::{c_void, c_int};
|
||||
use std::os::raw::{c_int, c_void};
|
||||
|
||||
use base::{Boolean, CFIndex, CFTypeID, CFOptionFlags, CFAllocatorRef};
|
||||
use string::CFStringRef;
|
||||
use runloop::CFRunLoopSourceRef;
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
|
||||
#![cfg_attr(all(feature="mac_os_10_7_support", feature="mac_os_10_8_features"), feature(linkage))] // back-compat requires weak linkage
|
||||
|
||||
extern crate libc;
|
||||
|
||||
pub mod array;
|
||||
pub mod base;
|
||||
pub mod bundle;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use libc::c_void;
|
||||
use std::os::raw::c_void;
|
||||
|
||||
use base::{CFAllocatorRef, CFIndex, CFTypeID, Boolean};
|
||||
use data::CFDataRef;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use libc::c_void;
|
||||
use std::os::raw::c_void;
|
||||
|
||||
use base::{CFAllocatorRef, CFTypeID, CFComparisonResult};
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use libc::c_void;
|
||||
use std::os::raw::c_void;
|
||||
|
||||
use array::CFArrayRef;
|
||||
use base::{Boolean, CFIndex, CFTypeID, CFAllocatorRef, CFOptionFlags, CFHashCode, mach_port_t};
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use libc::c_void;
|
||||
use std::os::raw::c_void;
|
||||
|
||||
use base::{CFAllocatorRef, CFIndex, CFTypeID};
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use libc::{c_char, c_ushort, c_void};
|
||||
use std::os::raw::{c_char, c_ushort, c_void};
|
||||
|
||||
use base::{Boolean, CFOptionFlags, CFIndex, CFAllocatorRef, CFRange, CFTypeID};
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use libc::c_void;
|
||||
use std::os::raw::c_void;
|
||||
|
||||
use base::{CFAllocatorRef, CFTypeID};
|
||||
use date::{CFTimeInterval, CFAbsoluteTime};
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
use libc::c_void;
|
||||
|
||||
use std::os::raw::c_void;
|
||||
|
||||
use base::{CFOptionFlags, CFIndex, CFAllocatorRef, Boolean, CFTypeID, CFTypeRef, SInt32};
|
||||
use string::{CFStringRef, CFStringEncoding};
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
use libc::c_void;
|
||||
|
||||
use std::os::raw::c_void;
|
||||
|
||||
use base::{CFAllocatorRef, CFTypeID};
|
||||
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
pub use core_foundation_sys::array::*;
|
||||
pub use core_foundation_sys::base::CFIndex;
|
||||
use core_foundation_sys::base::{CFTypeRef, CFRelease, kCFAllocatorDefault};
|
||||
use libc::c_void;
|
||||
use std::mem;
|
||||
use std::mem::ManuallyDrop;
|
||||
use std::marker::PhantomData;
|
||||
use std;
|
||||
use std::ops::Deref;
|
||||
use std::os::raw::c_void;
|
||||
use std::fmt::{Debug, Formatter};
|
||||
|
||||
use base::{CFIndexConvertible, TCFType, TCFTypeRef, CFRange};
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
pub use core_foundation_sys::dictionary::*;
|
||||
|
||||
use core_foundation_sys::base::{CFTypeRef, kCFAllocatorDefault};
|
||||
use libc::c_void;
|
||||
use std::mem;
|
||||
use std::os::raw::c_void;
|
||||
use std::ptr;
|
||||
|
||||
use base::{CFType, CFIndexConvertible, TCFType, TCFTypeRef};
|
||||
|
||||
@@ -107,9 +107,10 @@ mod test {
|
||||
|
||||
use super::*;
|
||||
use std::ffi::CString;
|
||||
use libc::{c_void, O_RDWR};
|
||||
use std::os::raw::c_void;
|
||||
use core_foundation_sys::base::{CFOptionFlags};
|
||||
use core_foundation_sys::runloop::{kCFRunLoopDefaultMode};
|
||||
use libc::O_RDWR;
|
||||
use runloop::{CFRunLoop};
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -11,8 +11,7 @@
|
||||
|
||||
use std::ptr;
|
||||
use std::mem;
|
||||
|
||||
use libc::c_void;
|
||||
use std::os::raw::c_void;
|
||||
|
||||
use error::CFError;
|
||||
use data::CFData;
|
||||
|
||||
@@ -152,7 +152,7 @@ mod test {
|
||||
use super::*;
|
||||
use date::{CFDate, CFAbsoluteTime};
|
||||
use std::mem;
|
||||
use libc::c_void;
|
||||
use std::os::raw::c_void;
|
||||
use std::sync::mpsc;
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
#[macro_use]
|
||||
extern crate core_foundation;
|
||||
extern crate libc;
|
||||
|
||||
use core_foundation::base::{CFComparisonResult, TCFType};
|
||||
use libc::c_void;
|
||||
use std::os::raw::c_void;
|
||||
|
||||
// sys equivalent stuff that must be declared
|
||||
|
||||
|
||||
Reference in New Issue
Block a user