diff --git a/Cargo.toml b/Cargo.toml index 806bfe520..a70092d0d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -106,7 +106,7 @@ windows = { version = ">=0.54, <=0.57", optional = true } libc = "^0.2.153" [target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies] -core-foundation-sys = "0.8" +core-foundation-sys = "0.8.7" [target.'cfg(all(target_os = "linux", not(target_os = "android")))'.dev-dependencies] tempfile = "3.9" diff --git a/src/unix/apple/macos/cpu.rs b/src/unix/apple/macos/cpu.rs index e96c2972f..974f4d0b7 100644 --- a/src/unix/apple/macos/cpu.rs +++ b/src/unix/apple/macos/cpu.rs @@ -10,6 +10,7 @@ pub(crate) unsafe fn get_cpu_frequency() -> u64 { use crate::sys::ffi; use crate::sys::macos::utils::IOReleaser; use crate::sys::utils::CFReleaser; + use core_foundation_sys::string::CFStringCreateWithCStringNoCopy; let matching = ffi::IOServiceMatching(b"AppleARMIODevice\0".as_ptr() as *const _); if matching.is_null() { @@ -54,7 +55,7 @@ pub(crate) unsafe fn get_cpu_frequency() -> u64 { } }; - let node_name = match CFReleaser::new(ffi::CFStringCreateWithCStringNoCopy( + let node_name = match CFReleaser::new(CFStringCreateWithCStringNoCopy( std::ptr::null(), b"voltage-states5-sram\0".as_ptr() as *const _, core_foundation_sys::string::kCFStringEncodingUTF8, diff --git a/src/unix/apple/macos/ffi.rs b/src/unix/apple/macos/ffi.rs index 3e0dfc6e0..80cb28126 100644 --- a/src/unix/apple/macos/ffi.rs +++ b/src/unix/apple/macos/ffi.rs @@ -144,17 +144,6 @@ extern "C" { ))] pub const KIO_RETURN_SUCCESS: i32 = 0; -extern "C" { - // FIXME: to be removed once higher version than core_foundation_sys 0.8.4 is released. - #[allow(dead_code)] - pub fn CFStringCreateWithCStringNoCopy( - alloc: CFAllocatorRef, - cStr: *const c_char, - encoding: core_foundation_sys::string::CFStringEncoding, - contentsDeallocator: CFAllocatorRef, - ) -> CFStringRef; -} - #[cfg(all( not(feature = "apple-sandbox"), all(