enumeration: simplify standard types in variants.

Fixes #745
This commit is contained in:
Emilio Cobos Álvarez
2022-03-31 22:05:21 +02:00
parent aeb81934d1
commit 09284108eb
13 changed files with 327 additions and 9 deletions
+7
View File
@@ -127,6 +127,12 @@ enum P {
P1(u8, u8, u8),
}
#[repr(C)]
enum Q {
Ok(Box<u32>),
Err(u32),
}
#[no_mangle]
pub extern "C" fn root(
opaque: *mut Opaque,
@@ -146,5 +152,6 @@ pub extern "C" fn root(
n: N,
o: O,
p: P,
q: Q,
) {
}
+20
View File
@@ -1,3 +1,18 @@
header = """
#if 0
''' '
#endif
#ifdef __cplusplus
template <typename T>
using Box = T*;
#endif
#if 0
' '''
#endif
"""
trailer = """
#if 0
''' '
@@ -15,5 +30,10 @@ static_assert(sizeof(CBINDGEN_STRUCT(P)) == 4, "unexpected size for P");
#endif
"""
[export]
exclude = [
"Box",
]
[export.rename]
"I" = "ExI"