Following https://github.com/mozilla/cbindgen/issues/967, introduce /// cbindgen:transparent-typedef annotation that causes cbindgen to replace transparent structs and typedefs with their underlying type.
This allows the following:
/// cbindgen:transparent-typedef
#[repr(transparent)]
struct Foo(NonNull<i32>);
/// cbindgen:transparent-typedef
type Function = extern "C" fn(i: i32) -> i64;
type NullableFoo = Option<Foo>;
type NullableFunction = Option<Function>;
template<typename T = void>
struct Option;
using Foo = int32_t*;
using Function = int64_t(*)(int32_t i);
using NullableFoo = Option<Foo>;
using NullableFunction = Option<Function>;
NOTE: This PR incorporates several other improvements that can be factored out as separate pull requests. The last commit is the actual prototype for this feature.
Following https://github.com/mozilla/cbindgen/issues/967, introduce
/// cbindgen:transparent-typedef
annotation that causes cbindgen to replace transparent structs and typedefs with their underlying type.This allows the following:
to export as
instead of today's output:
NOTE: This PR incorporates several other improvements that can be factored out as separate pull requests. The last commit is the actual prototype for this feature.