@@ -1538,12 +1538,16 @@ fn test_freebsd(target: &str) {
1538
1538
// Just pass all these through, no need for a "struct" prefix
1539
1539
"FILE" | "fd_set" | "Dl_info" | "DIR" => ty. to_string ( ) ,
1540
1540
1541
+ // FIXME: ?
1541
1542
"sighandler_t" => "sig_t" . to_string ( ) ,
1542
1543
1543
1544
t if is_union => format ! ( "union {}" , t) ,
1544
1545
1545
1546
t if t. ends_with ( "_t" ) => t. to_string ( ) ,
1546
1547
1548
+ // sigval is a struct in Rust, but a union in C:
1549
+ "sigval" => format ! ( "union sigval" ) ,
1550
+
1547
1551
// put `struct` in front of all structs:.
1548
1552
t if is_struct => format ! ( "struct {}" , t) ,
1549
1553
@@ -1565,16 +1569,6 @@ fn test_freebsd(target: &str) {
1565
1569
}
1566
1570
} ) ;
1567
1571
1568
- cfg. skip_struct ( move |ty| {
1569
- match ty {
1570
- // This is actually a union, not a struct
1571
- // FIXME: still required?
1572
- "sigval" => true ,
1573
-
1574
- _ => false ,
1575
- }
1576
- } ) ;
1577
-
1578
1572
cfg. skip_signededness ( move |c| {
1579
1573
match c {
1580
1574
// FIXME: still required?
@@ -1639,6 +1633,24 @@ fn test_freebsd(target: &str) {
1639
1633
}
1640
1634
} ) ;
1641
1635
1636
+ cfg. volatile_item ( |i| {
1637
+ use ctest:: VolatileItemKind :: * ;
1638
+ match i {
1639
+ // aio_buf is a volatile void** but since we cannot express that in
1640
+ // Rust types, we have to explicitly tell the checker about it here:
1641
+ StructField ( ref n, ref f) if n == "aiocb" && f == "aio_buf" => {
1642
+ true
1643
+ }
1644
+ _ => false ,
1645
+ }
1646
+ } ) ;
1647
+
1648
+ cfg. skip_field ( move |struct_, field| {
1649
+ // FIXME: `sa_sigaction` has type `sighandler_t` but that type is
1650
+ // incorrect, see: https://github.com/rust-lang/libc/issues/1359
1651
+ ( struct_ == "sigaction" && field == "sa_sigaction" )
1652
+ } ) ;
1653
+
1642
1654
cfg. generate ( "../src/lib.rs" , "main.rs" ) ;
1643
1655
}
1644
1656
0 commit comments