@@ -2473,8 +2473,8 @@ fn test_linux(target: &str) {
2473
2473
// FIXME: is this necessary?
2474
2474
"sighandler_t" => true ,
2475
2475
2476
- // FIXME: these types have a p_type member but some header
2477
- // has a define p_type __p_type macro that breaks their tests:
2476
+ // These cannot be tested when "resolv.h" is included and are tested
2477
+ // below.
2478
2478
"Elf64_Phdr" | "Elf32_Phdr" => true ,
2479
2479
2480
2480
_ => false ,
@@ -2486,8 +2486,8 @@ fn test_linux(target: &str) {
2486
2486
// FIXME: is this necessary?
2487
2487
"sockaddr_nl" if musl => true ,
2488
2488
2489
- // FIXME: these types have a p_type member but some header
2490
- // has a define p_type __p_type macro that breaks their tests:
2489
+ // These cannot be tested when "resolv.h" is included and are tested
2490
+ // below.
2491
2491
"Elf64_Phdr" | "Elf32_Phdr" => true ,
2492
2492
2493
2493
// On Linux, the type of `ut_tv` field of `struct utmpx`
@@ -2818,4 +2818,27 @@ fn test_linux(target: &str) {
2818
2818
t => t. to_string ( ) ,
2819
2819
} ) ;
2820
2820
cfg. generate ( "../src/lib.rs" , "linux_fcntl.rs" ) ;
2821
+
2822
+ // Test Elf64_Phdr and Elf32_Phdr
2823
+ // These types have a field called `p_type`, but including
2824
+ // "resolve.h" defines a `p_type` macro that expands to `__p_type`
2825
+ // making the tests for these fails when both are included.
2826
+ let mut cfg = ctest:: TestGenerator :: new ( ) ;
2827
+ cfg. skip_fn ( |_| true )
2828
+ . skip_const ( |_| true )
2829
+ . skip_static ( |_| true ) ;
2830
+ cfg. skip_struct ( move |ty| {
2831
+ match ty {
2832
+ "Elf64_Phdr" | "Elf32_Phdr" => false ,
2833
+ _ => true ,
2834
+ }
2835
+ } ) ;
2836
+ cfg. skip_type ( move |ty| {
2837
+ match ty {
2838
+ "Elf64_Phdr" | "Elf32_Phdr" => false ,
2839
+ _ => true ,
2840
+ }
2841
+ } ) ;
2842
+ cfg. header ( "linux/elf.h" ) ;
2843
+ cfg. generate ( "../src/lib.rs" , "linux_elf.rs" ) ;
2821
2844
}
0 commit comments