Skip to content

Latest commit

 

History

History
184 lines (99 loc) · 6.91 KB

CHANGELOG.md

File metadata and controls

184 lines (99 loc) · 6.91 KB

CGlue changelog

Changes in 0.3.0:

Enable with task feature. Provides C equivalents for Waker, RawWaker, RawWakerVtable.

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 });

The following now compiles:

#[cglue_trait]
pub trait WithAssoc<T> {
	type AssocTy: Clone;

	fn with_assoc(&self, assoc: &Self::AssocTy) -> T;
}

The following now works:

async fn hii() -> u64 {
    42
}

let obj = trait_obj!(hii() as Future);

assert_eq!(pollster::block_on(obj), 42);

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);

Changes in 0.2.14:

Add unstable task feature

Automatically wrap 'Into' arguments

Changes in 0.2.12:

Initial support for GAT lifetimes

Changes in 0.2.11:

Fix a safety bug with slices

Changes in 0.2.10:

Rename Tup to CTup

Changes in 0.2.9 (yanked):

Add C tuples

Changes in 0.2.8:

Allow to provide custom implemenetations for generics functions

Re-export custom_impl macro.

Changes in 0.2.7:

Add more helpers to CVec

Parse different expressions in the cast macros

Expose CArcSome:

  • This is equivalent to Arc, and is essentially a pre-null-checked version of CArc.

Changes in 0.2.5:

fix no_std build.

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 the c_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.

Add extra customization to C function impls.

Changes cglue-bindgen 0.2.2:

Make C++ generator to be C++11 friendly.

Changes in 0.2.2:

Fix no_std compilation.

Changes in 0.2.0:

Rework code generation:

  • 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.

Somewhat tested with miri:

  • Stacked borrows are disabled.

  • ABI checks have been patched out, because otherwise rust evaluator does not accept type erasure.

Vtable-only functions:

  • 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.