Ensure back-compat

This commit is contained in:
Steven Fackler
2015-08-25 21:31:41 -07:00
parent 00dc99e36b
commit a3ce1d3ac3
17 changed files with 43 additions and 24 deletions
+4 -1
View File
@@ -33,7 +33,10 @@ pub struct CFArrayCallBacks {
pub equal: CFArrayEqualCallBack,
}
pub type CFArrayRef = *const c_void;
#[repr(C)]
struct __CFArray;
pub type CFArrayRef = *const __CFArray;
extern {
/*
+10
View File
@@ -26,6 +26,16 @@ pub struct CFRange {
pub length: CFIndex
}
// for back-compat
impl CFRange {
pub fn init(location: CFIndex, length: CFIndex) -> CFRange {
CFRange {
location: location,
length: length,
}
}
}
extern {
/*
* CFBase.h
+4 -1
View File
@@ -12,7 +12,10 @@ use libc::c_void;
use base::CFTypeID;
use string::CFStringRef;
pub type CFBundleRef = *const c_void;
#[repr(C)]
struct __CFBundle;
pub type CFBundleRef = *const __CFBundle;
extern {
/*
+4 -3
View File
@@ -1,8 +1,9 @@
use libc::c_void;
use base::{CFAllocatorRef, CFTypeID, CFIndex};
pub type CFDataRef = *const c_void;
#[repr(C)]
struct __CFData;
pub type CFDataRef = *const __CFData;
extern {
/*
+4 -1
View File
@@ -11,7 +11,10 @@ use libc::c_void;
use base::{CFAllocatorRef, CFTypeID};
pub type CFBooleanRef = *const c_void;
#[repr(C)]
struct __CFBoolean;
pub type CFBooleanRef = *const __CFBoolean;
pub type CFNumberType = u32;
+6 -3
View File
@@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use libc::{c_char, c_void, c_ushort};
use libc::{c_char, c_ushort};
use base::{Boolean, CFOptionFlags, CFIndex, CFAllocatorRef, CFRange, CFTypeID};
@@ -49,7 +49,7 @@ pub static kCFStringEncodingUTF8: CFStringEncoding = 0x08000100;
// CFStringEncodingExt.h
type CFStringEncodings = CFIndex;
pub type CFStringEncodings = CFIndex;
// External encodings, except those defined above.
// Defined above: kCFStringEncodingMacRoman = 0
@@ -187,7 +187,10 @@ type CFStringEncodings = CFIndex;
//static kCFStringEncodingUTF7_IMAP: CFStringEncoding = 0x0A10;
//static kCFStringEncodingShiftJIS_X0213_00: CFStringEncoding = 0x0628; /* Deprecated */
pub type CFStringRef = *const c_void;
#[repr(C)]
struct __CFString;
pub type CFStringRef = *const __CFString;
extern {
/*
+1 -1
View File
@@ -9,7 +9,7 @@
//! Heterogeneous immutable arrays.
use core_foundation_sys::array::*;
pub use core_foundation_sys::array::*;
use core_foundation_sys::base::{CFIndex, CFRelease};
use core_foundation_sys::base::{CFTypeRef, kCFAllocatorDefault};
use libc::c_void;
+1 -1
View File
@@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use core_foundation_sys::base::*;
pub use core_foundation_sys::base::*;
pub trait CFIndexConvertible {
/// Always use this method to construct a `CFIndex` value. It performs bounds checking to
+1 -1
View File
@@ -10,7 +10,7 @@
//! A Boolean type.
use core_foundation_sys::base::{CFRelease};
use core_foundation_sys::number::{CFBooleanRef, CFBooleanGetTypeID, kCFBooleanTrue, kCFBooleanFalse};
pub use core_foundation_sys::number::{CFBooleanRef, CFBooleanGetTypeID, kCFBooleanTrue, kCFBooleanFalse};
use std::mem;
use base::TCFType;
+1 -1
View File
@@ -9,8 +9,8 @@
//! Core Foundation Bundle Type
pub use core_foundation_sys::bundle::*;
use core_foundation_sys::base::CFRelease;
use core_foundation_sys::bundle::{CFBundleRef, CFBundleGetTypeID};
use std::mem;
use base::{TCFType};
+1 -1
View File
@@ -9,9 +9,9 @@
//! Core Foundation byte buffers.
pub use core_foundation_sys::data::*;
use core_foundation_sys::base::{CFIndex, CFRelease};
use core_foundation_sys::base::{kCFAllocatorDefault};
use core_foundation_sys::data::*;
use std::mem;
use std::ops::Deref;
use std::slice;
+1 -1
View File
@@ -9,9 +9,9 @@
//! Dictionaries of key-value pairs.
pub use core_foundation_sys::dictionary::*;
use core_foundation_sys::base::CFRelease;
use core_foundation_sys::base::{CFTypeRef, kCFAllocatorDefault};
use core_foundation_sys::dictionary::*;
use libc::c_void;
use std::mem;
use std::ptr;
+1 -3
View File
@@ -9,10 +9,8 @@
//! Immutable numbers.
#![allow(non_upper_case_globals)]
use core_foundation_sys::base::{CFRelease, kCFAllocatorDefault};
use core_foundation_sys::number::*;
pub use core_foundation_sys::number::*;
use std::mem;
use base::{TCFType};
+1 -1
View File
@@ -9,11 +9,11 @@
#![allow(non_upper_case_globals)]
pub use core_foundation_sys::runloop::*;
use core_foundation_sys::base::{CFIndex, CFRelease};
use core_foundation_sys::base::{kCFAllocatorDefault, CFOptionFlags};
use core_foundation_sys::string::CFStringRef;
use core_foundation_sys::date::{CFAbsoluteTime, CFTimeInterval};
use core_foundation_sys::runloop::*;
use std::mem;
use base::{TCFType};
+1 -1
View File
@@ -9,9 +9,9 @@
//! An immutable bag of elements.
pub use core_foundation_sys::set::*;
use core_foundation_sys::base::CFRelease;
use core_foundation_sys::base::{CFTypeRef, kCFAllocatorDefault};
use core_foundation_sys::set::*;
use base::{CFIndexConvertible, TCFType};
+1 -2
View File
@@ -9,13 +9,12 @@
//! Immutable strings.
#![allow(non_upper_case_globals)]
pub use core_foundation_sys::string::*;
use base::{CFIndexConvertible, TCFType};
use core_foundation_sys::base::{Boolean, CFIndex, CFRange, CFRelease};
use core_foundation_sys::base::{kCFAllocatorDefault, kCFAllocatorNull};
use core_foundation_sys::string::*;
use std::fmt;
use std::str::{self, FromStr};
use std::mem;
+1 -2
View File
@@ -9,13 +9,12 @@
//! A URL type for Core Foundation.
#![allow(non_upper_case_globals)]
pub use core_foundation_sys::url::*;
use base::{TCFType};
use string::{CFString};
use core_foundation_sys::base::{kCFAllocatorDefault, CFRelease};
use core_foundation_sys::url::*;
use std::fmt;
use std::mem;