Skip to content

Commit 0bd3900

Browse files
xingxue-ibmtgross35
authored andcommitted
aix: Fix swapped struct/union test skips and missing c_enum
Closes: #4870 [ replace the commit summary - Trevor ]
1 parent b7ee745 commit 0bd3900

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

libc-test/build.rs

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5482,14 +5482,24 @@ fn test_aix(target: &str) {
54825482

54835483
cfg.skip_struct(move |struct_| {
54845484
match struct_.ident() {
5485-
// '__poll_ctl_ext_u' and '__pollfd_ext_u' are for unnamed unions.
5486-
"__poll_ctl_ext_u" => true,
5487-
"__pollfd_ext_u" => true,
5488-
54895485
// 'struct fpreg_t' is not defined in AIX headers. It is created to
54905486
// allow type 'double' to be used in signal contexts.
54915487
"fpreg_t" => true,
54925488

5489+
// These structures are guarded by the `_KERNEL` macro in the AIX
5490+
// header.
5491+
"fileops_t" | "file" => true,
5492+
5493+
_ => false,
5494+
}
5495+
});
5496+
5497+
cfg.skip_union(|union_| {
5498+
match union_.ident() {
5499+
// '__poll_ctl_ext_u' and '__pollfd_ext_u' are for unnamed unions.
5500+
"__poll_ctl_ext_u" => true,
5501+
"__pollfd_ext_u" => true,
5502+
54935503
// This type is defined for a union used within `struct ld_info`.
54945504
// The AIX header does not declare a separate standalone union
54955505
// type for it.
@@ -5498,10 +5508,6 @@ fn test_aix(target: &str) {
54985508
// This is a simplified version of the AIX union `_simple_lock`.
54995509
"_kernel_simple_lock" => true,
55005510

5501-
// These structures are guarded by the `_KERNEL` macro in the AIX
5502-
// header.
5503-
"fileops_t" | "file" => true,
5504-
55055511
_ => false,
55065512
}
55075513
});
@@ -5628,6 +5634,9 @@ fn test_aix(target: &str) {
56285634
_ => false,
56295635
});
56305636

5637+
let c_enums = ["uio_rw"];
5638+
cfg.alias_is_c_enum(move |e| c_enums.contains(&e));
5639+
56315640
ctest::generate_test(&mut cfg, "../src/lib.rs", "ctest_output.rs").unwrap();
56325641
}
56335642

0 commit comments

Comments
 (0)