Port boolean to sys crate
This commit is contained in:
@@ -4,3 +4,4 @@ extern crate libc;
|
||||
|
||||
pub mod array;
|
||||
pub mod base;
|
||||
pub mod number;
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
use libc::c_void;
|
||||
|
||||
use base::CFTypeID;
|
||||
|
||||
pub type CFBooleanRef = *const c_void;
|
||||
|
||||
extern {
|
||||
pub static kCFBooleanTrue: CFBooleanRef;
|
||||
pub static kCFBooleanFalse: CFBooleanRef;
|
||||
|
||||
pub fn CFBooleanGetTypeID() -> CFTypeID;
|
||||
}
|
||||
@@ -9,18 +9,12 @@
|
||||
|
||||
//! A Boolean type.
|
||||
|
||||
use core_foundation_sys::base::{CFRelease, CFTypeID};
|
||||
use core_foundation_sys::base::{CFRelease};
|
||||
use core_foundation_sys::number::{CFBooleanRef, CFBooleanGetTypeID, kCFBooleanTrue, kCFBooleanFalse};
|
||||
use std::mem;
|
||||
|
||||
use base::TCFType;
|
||||
|
||||
pub type Boolean = u32;
|
||||
|
||||
#[repr(C)]
|
||||
struct __CFBoolean;
|
||||
|
||||
pub type CFBooleanRef = *const __CFBoolean;
|
||||
|
||||
/// A Boolean type.
|
||||
///
|
||||
/// FIXME(pcwalton): Should be a newtype struct, but that fails due to a Rust compiler bug.
|
||||
@@ -49,12 +43,3 @@ impl CFBoolean {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[link(name = "CoreFoundation", kind = "framework")]
|
||||
extern {
|
||||
static kCFBooleanTrue: CFBooleanRef;
|
||||
static kCFBooleanFalse: CFBooleanRef;
|
||||
|
||||
fn CFBooleanGetTypeID() -> CFTypeID;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user