From 58d4a0a020a59b0e4ae01defe96404ddd56710cf Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Wed, 13 Nov 2019 00:05:55 -0800 Subject: [PATCH] remove local workaround for core-foundation UB issue My fixes landed upstream in https://github.com/servo/core-foundation-rs/commit/0a3ac83c1bb38d30a4d30530cd233385b7410b2c and are released already to crates.io --- Cargo.toml | 6 ++--- window/Cargo.toml | 6 ++--- window/src/os/macos/connection.rs | 39 ------------------------------- 3 files changed, 6 insertions(+), 45 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c9e342c1b..7a07613d1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -83,9 +83,9 @@ openssl = "0.10" [target.'cfg(target_os = "macos")'.dependencies] openssl = { version = "0.10", features = ["vendored"] } -core-foundation = "0.6" -core-graphics = "0.17" -core-text = "13.3" +core-foundation = "0.7" +core-graphics = "0.19" +core-text = "15.0" [workspace] diff --git a/window/Cargo.toml b/window/Cargo.toml index 4fbed018a..5e887bce4 100644 --- a/window/Cargo.toml +++ b/window/Cargo.toml @@ -50,8 +50,8 @@ mio-extras = "2.0" libc = "0.2" [target.'cfg(target_os="macos")'.dependencies] -cocoa = "0.19" +cocoa = "0.20" objc = "0.2" -core-foundation = "0.6" -core-graphics = "0.17" +core-foundation = "0.7" +core-graphics = "0.19" cgl = { version = "0.3", optional = true } diff --git a/window/src/os/macos/connection.rs b/window/src/os/macos/connection.rs index b1108b2d6..8bfa659e8 100644 --- a/window/src/os/macos/connection.rs +++ b/window/src/os/macos/connection.rs @@ -69,45 +69,6 @@ impl Connection { } } -/* Begin: workaround UB in CFRunLoopTimerContext struct. - * This can be removed once an equivalent change is upstreamed to the - * core_foundation crate */ - -use core_foundation::string::__CFString; -use std::ffi::c_void; - -#[repr(transparent)] -pub struct __CFRunLoopTimer(c_void); - -#[repr(C)] -#[allow(non_snake_case)] -pub struct CFRunLoopTimerContext { - pub version: i64, - pub info: *mut c_void, - pub retain: Option *const c_void>, - pub release: Option, - pub copyDescription: Option *const __CFString>, -} - -extern "C" { - fn CFRunLoopTimerCreate( - allocator: *const c_void, - fireDate: f64, - interval: f64, - flags: u32, - order: i64, - callout: extern "C" fn(*mut __CFRunLoopTimer, *mut c_void), - context: *mut CFRunLoopTimerContext, - ) -> *mut __CFRunLoopTimer; - fn CFRunLoopAddTimer( - rl: *mut __CFRunLoop, - timer: *mut __CFRunLoopTimer, - mode: *const __CFString, - ); -} - -/* End: UB workaround */ - impl ConnectionOps for Connection { fn terminate_message_loop(&self) { unsafe {