diff --git a/core-foundation-sys/Cargo.toml b/core-foundation-sys/Cargo.toml index 769fbc4..f1dd3e3 100644 --- a/core-foundation-sys/Cargo.toml +++ b/core-foundation-sys/Cargo.toml @@ -3,7 +3,7 @@ name = "core-foundation-sys" description = "Bindings to Core Foundation for OS X" homepage = "https://github.com/servo/core-foundation-rs" repository = "https://github.com/servo/core-foundation-rs" -version = "0.4.1" +version = "0.4.2" authors = ["The Servo Project Developers"] license = "MIT / Apache-2.0" build = "build.rs" diff --git a/core-foundation-sys/src/number.rs b/core-foundation-sys/src/number.rs index 05758f3..3a5c09f 100644 --- a/core-foundation-sys/src/number.rs +++ b/core-foundation-sys/src/number.rs @@ -37,8 +37,9 @@ pub static kCFNumberFloat64Type: CFNumberType = 6; // static kCFNumberCGFloatType: CFNumberType = 16; // static kCFNumberMaxType: CFNumberType = 16; -#[repr(C)] -pub struct __CFNumber; +// This is an enum due to zero-sized types warnings. +// For more details see https://github.com/rust-lang/rust/issues/27303 +pub enum __CFNumber {} pub type CFNumberRef = *const __CFNumber; diff --git a/core-foundation/Cargo.toml b/core-foundation/Cargo.toml index dd3775b..e338b16 100644 --- a/core-foundation/Cargo.toml +++ b/core-foundation/Cargo.toml @@ -3,13 +3,13 @@ name = "core-foundation" description = "Bindings to Core Foundation for OS X" homepage = "https://github.com/servo/core-foundation-rs" repository = "https://github.com/servo/core-foundation-rs" -version = "0.4.1" +version = "0.4.2" authors = ["The Servo Project Developers"] license = "MIT / Apache-2.0" [dependencies.core-foundation-sys] path = "../core-foundation-sys" -version = "0.4.0" +version = "0.4.2" [dependencies] libc = "0.2" diff --git a/core-foundation/src/runloop.rs b/core-foundation/src/runloop.rs index 5655535..ccc1f78 100644 --- a/core-foundation/src/runloop.rs +++ b/core-foundation/src/runloop.rs @@ -125,8 +125,9 @@ mod test { let run_loop_timer = CFRunLoopTimer::new(now + 0.20f64, 0f64, 0, 0, timer_popped, &mut context); - run_loop.add_timer(&run_loop_timer, kCFRunLoopDefaultMode); - + unsafe { + run_loop.add_timer(&run_loop_timer, kCFRunLoopDefaultMode); + } CFRunLoop::run_current(); }