Commit Graph

10 Commits

Author SHA1 Message Date
michaelwright235 d2eed27ec6 sys: runloop: Implement platform dependent variants of 2 fields
of CFRunLoopSourceContext1 structure.
2023-06-02 10:01:10 +03:00
michaelwright235 2d350e57f3 sys: runloop: Derive Debug for structs 2023-06-02 10:00:51 +03:00
Wez Furlong cf3659fc6f Fix CFRunLoop types to avoid UB
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.
2019-11-11 19:57:48 -08:00
Bruce Mitchener d2d3b3362a Refer to macOS rather than OS X. 2019-03-14 17:47:00 +07:00
Bruce Mitchener 7e7d65bb4d Reduce usage of libc crate.
Switch from using `libc` types to `::std::os::raw`. This is a breaking
change due to the differences in how `c_void` is defined.

`core-foundation-sys` no longer needs the `libc` dependency.
2018-02-01 20:39:10 +07:00
Josh Matthews 53609f26ac Respect const/mut of system headers. 2018-01-26 13:46:06 -05:00
Steven Fackler 1b3d4982f6 Fix private type in public API warnings 2016-04-17 22:39:46 -07:00
Steven Fackler db4499d7b4 Fix new ctype lint in 1.3 2015-09-19 19:16:18 -07:00
Steven Fackler 00dc99e36b Add licenses to sys crate 2015-09-05 21:42:50 -07:00
Steven Fackler ed048f1c62 Move runloop to sys directory 2015-09-05 21:40:55 -07:00