Port boolean to sys crate

This commit is contained in:
Steven Fackler
2015-08-24 23:14:07 -07:00
parent 3f725f97eb
commit 6ffe3ea04f
3 changed files with 15 additions and 17 deletions
+1
View File
@@ -4,3 +4,4 @@ extern crate libc;
pub mod array;
pub mod base;
pub mod number;
+12
View File
@@ -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;
}
+2 -17
View File
@@ -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;
}