Add a derive_constructor option to generate struct constructors

This commit is contained in:
Kartikaya Gupta
2018-01-25 09:35:09 -05:00
committed by Ryan Hunt
parent 59104b1efa
commit 2ccaa3e956
4 changed files with 57 additions and 0 deletions
+4
View File
@@ -9,6 +9,10 @@ enum class C : uint32_t {
struct A {
int32_t m0;
A(int32_t const& aM0)
: m0(aM0)
{}
bool operator<(const A& other) const {
return m0 < other.m0;
}
+1
View File
@@ -1,5 +1,6 @@
/// cbindgen:derive-lt=true
/// cbindgen:derive-lte=true
/// cbindgen:derive-constructor=true
/// cbindgen:rename-all=GeckoCase
#[repr(C)]
struct A(i32);