Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowone committed May 27, 2024
1 parent 99d5ad5 commit 41d3ce9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/expectations/cfg.compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ typedef struct {
#endif
;
} ConditionalField;
#define ConditionalField_ZERO (ConditionalField){
#if defined(X11)
.field = 0
#endif
}

typedef struct {
int32_t x;
Expand Down
7 changes: 7 additions & 0 deletions tests/rust/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ struct ConditionalField {
field: i32,
}

impl ConditionalField {
pub const ZERO: Self = Self {
#[cfg(x11)]
field: 0,
};
}

#[cfg(all(unix, x11))]
#[no_mangle]
pub extern "C" fn root(a: FooHandle, c: C)
Expand Down

0 comments on commit 41d3ce9

Please sign in to comment.