Commit Graph

95 Commits

Author SHA1 Message Date
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
Josh Matthews ae995daaab Minor version update for core-foundation-sys and core-foundation. 2019-11-05 12:54:59 +01:00
Wesley Moore b2a4a0e566 Add CFDataGetBytes to CFData bindings 2019-10-15 09:53:39 +11:00
Wesley Moore 35e3e5b5c1 Add CFCharacterSet to core-foundation-sys 2019-10-10 15:33:37 +11:00
Aleksi Juvani 552021c096 Fix i686-apple-darwin compile target 2019-08-22 21:56:34 +03:00
Eike Siewertsen 1a0e69872a add shared_support_url to CFBundle 2019-08-05 10:50:58 +02:00
Bruce Mitchener d2d3b3362a Refer to macOS rather than OS X. 2019-03-14 17:47:00 +07:00
acheronfail cf356f6c61 chore: add CF functions for using bookmark data
fixes #116 (a closed issue)
2018-11-09 12:20:09 +11:00
Jeff Muizelaar 0b377a959b Bump the versions of a bunch crates. 2018-09-28 13:19:37 -04:00
Jeff Muizelaar 4fe550a8fc Bump minor version of core-foundation for past changes. 2018-07-12 10:14:25 -04:00
Ryan Leckey 1d369075c3 Add CF(Mutable)AttributedString and a couple helpers 2018-07-06 12:25:18 -07:00
Jeff Muizelaar bb9ce9e8e1 Update all of the major versions for the new releases
Basically everything needed to be bumped because of changes to
core-foundation-sys
2018-05-02 17:46:00 -04: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
Bruce Mitchener bf3a9c89bd Add missing license headers to src files. 2018-02-01 09:32:29 +07:00
bors-servo ff67c15632 Auto merge of #153 - servo:updateversion, r=jdm
Bump version to 0.5.1.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-foundation-rs/153)
<!-- Reviewable:end -->
2018-01-26 13:01:11 -06:00
Josh Matthews 5d7753a78a Bump version to 0.5.1. 2018-01-26 13:48:25 -05:00
Josh Matthews 53609f26ac Respect const/mut of system headers. 2018-01-26 13:46:06 -05:00
Linus Färnstrand 7e87a9d8fa Bump version to 0.5.0 2018-01-24 08:57:50 +01:00
Linus Färnstrand 3aa63aa5b7 Add TCFTypeRef trait 2018-01-23 22:35:52 +01:00
Linus Färnstrand 249300d8ab Change CFErrorRef to *const ptr instead of *mut 2018-01-23 22:35:52 +01:00
bors-servo 2d35ed2d49 Auto merge of #84 - trlim:filedescriptor, r=jdm
Add bindings for `CFFileDescriptor`

This pull request adds implementation of `CFFileDescriptor` and `CFRunLoopSource` related API.

<!-- Reviewable:start -->

---

This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-foundation-rs/84)

<!-- Reviewable:end -->
2018-01-20 17:17:36 -06:00
bors-servo a4cee535b6 Auto merge of #144 - Nemo157:publish-licenses, r=jdm
Include license files in packages

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-foundation-rs/144)
<!-- Reviewable:end -->
2018-01-20 13:01:36 -06:00
Wim Looman 6bf580ee28 Include license files in packages 2018-01-17 20:52:01 +01:00
Tae-il Lim 530f732ce8 Implement CFFileDescriptor 2018-01-15 14:35:16 +09:00
Dan Glastonbury 6a77e377ba Add CFMutableDictionary type.
Added CFMutableDictionary that presents the mutable dictionary
functions of CF. Tries to present a similar interface as CFDictionary.

Fixes issue #93.
2017-11-29 12:50:05 +10:00
Linus Färnstrand c33598dc99 Bump version to 0.4.6 2017-11-28 16:46:33 +01:00
Anthony Ramine cc66c00ac3 Bump core-foundation-sys version to 0.4.5
This is needed to publish a new core-foundation-rs version.
2017-11-27 14:30:18 +01:00
ratake 7b6fbdb1a1 Added support for CFTimeZone objects 2017-11-12 17:43:31 -08:00
ratake 79cd89bd5d Added support for CFDate objects 2017-11-12 17:43:31 -08:00
ratake e3fc4fe3e4 Implement Debug for all types 2017-11-12 17:41:29 -08:00
bors-servo fda0928c53 Auto merge of #124 - ratake:uuid-crate, r=jdm
Made CFUUID interoperable with the uuid crate

Behind the `with-uuid` feature

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-foundation-rs/124)
<!-- Reviewable:end -->
2017-11-08 07:58:55 -06:00
ratake b81cfce569 Made CFUUID interoperable with the uuid crate 2017-11-07 20:49:25 -08:00
ratake 2e2e6af6d8 Implement Ord for CFNumber 2017-11-07 20:44:13 -08:00
ratake d20b8abc9c Implement Eq for all types 2017-11-07 20:44:12 -08:00
bors-servo 2ceebd44fe Auto merge of #121 - jrmuizel:uuid, r=jdm
Add support for CFUUID

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-foundation-rs/121)
<!-- Reviewable:end -->
2017-10-20 10:46:12 -05:00
bors-servo dd3b248259 Auto merge of #119 - jrmuizel:cfurl-fs, r=jdm
Add CFURLGetFileSystemRepresentation

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-foundation-rs/119)
<!-- Reviewable:end -->
2017-10-20 07:49:22 -05:00
Jeff Muizelaar 6ca30dd9a8 Add support for CFUUID 2017-10-19 22:29:25 -04:00
Jeff Muizelaar a6dc32cf50 Support converting non-utf8 paths to CFURLs 2017-10-19 18:17:26 -04:00
Jeff Muizelaar 04fd67e25b Add CFURLGetFileSystemRepresentation 2017-10-19 17:36:54 -04:00
ratake 0dd90e84ae Complete the CFAllocator reference 2017-10-12 21:48:29 -07:00
ratake a622566dc4 Correct the definition for CFStringCreateWithBytes 2017-10-12 21:48:29 -07:00
ratake 7b0544fef6 Add support for f32 to CFNumber 2017-10-12 21:48:29 -07:00
ratake dcc0a07776 Complete the types for CFArrayCallBacks and CFDictionaryCallBacks 2017-10-12 21:48:29 -07:00
Kornel 3542722369 Bump version 2017-08-09 13:10:40 +01:00
Kornel b92e86c77f Prevent build error on Linux 2017-08-09 13:07:55 +01:00
Kornel 5a83faa547 Bump version number 2017-08-08 23:54:15 +01:00
Kornel fe6edb78b9 Fix return types 2017-08-08 15:06:15 +01:00
Kornel ba3e78cd3e Add 10.8-only constant 2017-08-08 14:31:38 +01:00
Kornel d32bc9ea23 10.7/10.8 compatibility features 2017-08-08 14:31:38 +01:00
Kornel d0e0b1a34d Add CFURL functions 2017-08-08 13:12:25 +01:00