Skip to content

Commit

Permalink
Update core-foundation-sys version
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Nov 10, 2024
1 parent 078c819 commit edff21c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion src/unix/apple/macos/cpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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,
Expand Down
11 changes: 0 additions & 11 deletions src/unix/apple/macos/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit edff21c

Please sign in to comment.