mirror of
https://github.com/encounter/core-foundation-rs.git
synced 2026-03-30 11:04:19 -07:00
cf3659fc6f88cbbc19a2f99e2a02ed2c058fd036
A number of callback functions associated with the CFRunLoop types are allowed to be NULL to evoke default behavior. Prior to this commit the definition of those structs prevented passing in null which meant resorting to transmute or other tricks to effectively set null, but with recent compiler versions the compiler emits `ud2` instructions and triggers a fault at runtime. The correct resolution for this is to define these fields as `Option`al callbacks and that is what this commit does. I've used this approach successfully here in another project: Refs: https://github.com/wez/wezterm/commit/398f333c32fb1ff4ccd9cc001a66ae22522eb60c I've bumped up the version for the crate as part of this commit because it effectively changes the API around these structs.
core-foundation-rs
Compatibility
Targets macOS 10.7 by default.
To enable features added in macOS 10.8, set Cargo feature mac_os_10_8_features. To have both 10.8 features and 10.7 compatibility, also set mac_os_10_7_support. Setting both requires weak linkage, which is a nightly-only feature as of Rust 1.19.
For more experimental but more complete, generated bindings take a look at https://github.com/michaelwu/RustKit.
Description
Languages
Rust
100%