Fix the definition of CFAllocatorContext

The function pointers can be null so should be wrapped in Option.

This struct was basically unusable before so I think we should
be fine making this change while only bumping the patch version.
I was unable to find any uses of it on github.
This commit is contained in:
Jeff Muizelaar
2020-10-13 17:52:31 -04:00
parent d540fee244
commit c55fd48fbe
2 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ name = "core-foundation-sys"
description = "Bindings to Core Foundation for macOS"
homepage = "https://github.com/servo/core-foundation-rs"
repository = "https://github.com/servo/core-foundation-rs"
version = "0.8.1"
version = "0.8.2"
authors = ["The Servo Project Developers"]
license = "MIT / Apache-2.0"
build = "build.rs"
+7 -7
View File
@@ -71,13 +71,13 @@ pub type CFAllocatorPreferredSizeCallBack = extern "C" fn(size: CFIndex, hint: C
pub struct CFAllocatorContext {
pub version: CFIndex,
pub info: *mut c_void,
pub retain: CFAllocatorRetainCallBack,
pub release: CFAllocatorReleaseCallBack,
pub copyDescription: CFAllocatorCopyDescriptionCallBack,
pub allocate: CFAllocatorAllocateCallBack,
pub reallocate: CFAllocatorReallocateCallBack,
pub deallocate: CFAllocatorDeallocateCallBack,
pub preferredSize: CFAllocatorPreferredSizeCallBack
pub retain: Option<CFAllocatorRetainCallBack>,
pub release: Option<CFAllocatorReleaseCallBack>,
pub copyDescription: Option<CFAllocatorCopyDescriptionCallBack>,
pub allocate: Option<CFAllocatorAllocateCallBack>,
pub reallocate: Option<CFAllocatorReallocateCallBack>,
pub deallocate: Option<CFAllocatorDeallocateCallBack>,
pub preferredSize: Option<CFAllocatorPreferredSizeCallBack>
}
/// Trait for all types which are Core Foundation reference types.