Partially support #[cfg]s on fields
This commit is contained in:
committed by
Emilio Cobos Álvarez
parent
dfcee869ba
commit
1963f0c92e
@@ -40,6 +40,15 @@ struct BarHandle {
|
||||
y: f32,
|
||||
}
|
||||
|
||||
// FIXME(#634): Support deriving methods for structs with conditional fields.
|
||||
/// cbindgen:derive-eq=false
|
||||
/// cbindgen:derive-neq=false
|
||||
#[repr(C)]
|
||||
struct ConditionalField {
|
||||
#[cfg(x11)]
|
||||
field: i32,
|
||||
}
|
||||
|
||||
#[cfg(all(unix, x11))]
|
||||
#[no_mangle]
|
||||
pub extern "C" fn root(a: FooHandle, c: C)
|
||||
@@ -49,3 +58,7 @@ pub extern "C" fn root(a: FooHandle, c: C)
|
||||
#[no_mangle]
|
||||
pub extern "C" fn root(a: BarHandle, c: C)
|
||||
{ }
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn cond(a: ConditionalField)
|
||||
{ }
|
||||
|
||||
Reference in New Issue
Block a user