Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce usage of libc crate. #156

Merged
merged 1 commit into from Feb 2, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -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

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.