Releases: h33p/cglue
v0.3.5
Changes in 0.3.5:
Support C-unwind
ABI
Adds support for extern "C-unwind"
ABI through #[unwind_abi]
attribute and unwind_abi_default
/unwind_abi_ext
feature flags:
unwind_abi_default
will default all functions to support unwinding, which can be overridden with#[no_unwind_abi]
attribute.unwind_abi_ext
will add#[unwind_abi]
to all functions in the builtin ext system.
Add CWaker
Exposes CWaker
as a static stable ABI waker type.
v0.3.4
Changes in 0.3.4:
Stabilize task
feature
Enable with task
feature. Provides C equivalents for Waker
, RawWaker
, RawWakerVtable
.
Trait alias within trait groups
Enables specifying different generic instantiations of the same trait in the same group. Example:
cglue_trait_group!(TestGroupGen, TT<u8>, { TT<usize> = TTUsize, TT<u64> = TTUSixtyFour });
cglue_impl_group!(SA, TestGroupGen, { TT<usize> = TTUsize });
Support traits with associated types
The following now compiles:
#[cglue_trait]
pub trait WithAssoc<T> {
type AssocTy: Clone;
fn with_assoc(&self, assoc: &Self::AssocTy) -> T;
}
Add Future support + Pin Self parameters
The following now works:
async fn hii() -> u64 {
42
}
let obj = trait_obj!(hii() as Future);
assert_eq!(pollster::block_on(obj), 42);
Add futures Stream+Sink support
The following now works:
let items = [42, 43, 42];
let obj = trait_obj!(futures::stream::iter(items) as Stream);
assert_eq!(pollster::block_on(obj.collect::<Vec<_>>()), items);
Fix #17
Add Send
bound to Opaquable for CBox
to hack around a soundness issue
v0.2.12
Changes in 0.2.12:
CGlue 0.2.11
Changes in 0.2.11:
CGlue 0.2.10
Changes in 0.2.10:
Changes in 0.2.9 (yanked):
Changes in 0.2.8:
Allow to provide custom implemenetations for generics functions
Re-export custom_impl
macro.
Changes in 0.2.7:
Parse different expressions in the cast macros
- This is equivalent to
Arc
, and is essentially a pre-null-checked version ofCArc
.
CGlue 0.2.5
Changes in 0.2.5:
CGlue 0.2.4
Changes in 0.2.4:
Make cglue generated exports easier to import:
-
cglue_##trait_or_groupname
module is exposed as public that contains all types that are being re-exported to parent module. -
In the future, these types may not be re-exported anymore, and code generator may rely on
cglue_##trait_or_groupname
to exist in scope for cleaner code generation.
Add boxed slice, CVec, and add more serde support.
Compatible with official abi_stable:
-
Users should now use
cglue::trait_group::c_void
as thec_void
type. -
Technically breaks semver, but it is not possible to do anything with
c_void
anyways.
Changes in 0.2.3:
Make formatting traits FFI-safe:
-
All standard fmt traits are exposed.
-
Only Debug and Display are in the prefix.
-
Not full formatting functionality is preserved across FFI boundary.
CGlue 0.2.2
Changes in 0.2.2:
Fix no_std compilation.
Remove 0.2.1. Don't ask.
CGlue 0.2.0
Changes in 0.2.0:
-
Make code generator emit C functions that take in a single object that contains both the object and the return context. This simplifies usage from C/C++.
-
Remove zero wrapper optimization. The above is incompatible with it.
-
Remove CtxBox, as context has been moved into the container object.
Context is now always Clone + Send + Sync
.
Ergonomic C/C++ wrappers:
-
In C++ trait objects and groups have member functions and destructors defined. Trait objects and groups themselves are ABI-incompatible when passed by value.
-
In C there are inline functions for invoking behavior. Some of the functions accept void pointers, because they are compatible with multiple variations of the same CGlue object.
-
Ability to specify default container and context types, so that the wrappers become more compact.
-
Manual cleanup is no longer supported as bindgen has become more complex.
-
Stacked borrows are disabled.
-
ABI checks have been patched out, because otherwise rust evaluator does not accept type erasure.
- Provide Rust functionality in C/C++ with slightly different types.
Wrap strings and slices in return types.
Unstable feature to auto-impl groups:
-
Auto-enables the widest set of optional traits for any given type.
-
Makes
cglue_impl_group!
a no-op.
Runtime ABI/API validation with abi_stable.
Remove no_empty_retwrap feature.
Replace CArc with COptArc, make old CArc private:
- COptArc was always the prefered choice, as it allowed to also represent
None
in the same amount of space.