From 34788869ec212947991ef6ba7938730c60a112a4 Mon Sep 17 00:00:00 2001 From: michaelwright235 Date: Sun, 18 Jun 2023 19:04:31 +0300 Subject: [PATCH] sys: Fix CFComparatorFunction and move it to `base` module CFComparatorFunction declaration was missing one argument. It's also declared in `CFBase.h`, so I moved it to `base` module. --- core-foundation-sys/src/array.rs | 3 +-- core-foundation-sys/src/base.rs | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core-foundation-sys/src/array.rs b/core-foundation-sys/src/array.rs index fae8ae5..d85b6dc 100644 --- a/core-foundation-sys/src/array.rs +++ b/core-foundation-sys/src/array.rs @@ -9,7 +9,7 @@ use std::os::raw::c_void; -use base::{CFRange, CFIndex, CFAllocatorRef, CFTypeID, Boolean, CFComparisonResult}; +use base::{CFRange, CFIndex, CFAllocatorRef, CFTypeID, Boolean, CFComparatorFunction}; use string::CFStringRef; pub type CFArrayRetainCallBack = extern "C" fn(allocator: CFAllocatorRef, value: *const c_void) -> *const c_void; @@ -17,7 +17,6 @@ pub type CFArrayReleaseCallBack = extern "C" fn(allocator: CFAllocatorRef, value pub type CFArrayCopyDescriptionCallBack = extern "C" fn(value: *const c_void) -> CFStringRef; pub type CFArrayEqualCallBack = extern "C" fn(value1: *const c_void, value2: *const c_void) -> Boolean; pub type CFArrayApplierFunction = extern "C" fn(value: *const c_void, context: *mut c_void); -pub type CFComparatorFunction = extern "C" fn(val1: *const c_void, val2: *const c_void) -> CFComparisonResult; #[repr(C)] #[derive(Clone, Copy, Debug)] diff --git a/core-foundation-sys/src/base.rs b/core-foundation-sys/src/base.rs index f4cb445..c0783ed 100644 --- a/core-foundation-sys/src/base.rs +++ b/core-foundation-sys/src/base.rs @@ -44,6 +44,8 @@ pub enum CFComparisonResult { GreaterThan = 1, } +pub type CFComparatorFunction = extern "C" fn(val1: *const c_void, val2: *const c_void, context: *mut c_void) -> CFComparisonResult; + impl Into for CFComparisonResult { fn into(self) -> Ordering { match self {