@@ -287,9 +287,11 @@ fn test_openbsd(target: &str) {
287
287
cfg. flag ( "-Wno-deprecated-declarations" ) ;
288
288
289
289
headers ! { cfg:
290
+ "elf.h" ,
290
291
"errno.h" ,
291
292
"fcntl.h" ,
292
293
"limits.h" ,
294
+ "link.h" ,
293
295
"locale.h" ,
294
296
"stddef.h" ,
295
297
"stdint.h" ,
@@ -387,7 +389,9 @@ fn test_openbsd(target: &str) {
387
389
cfg. type_name ( move |ty, is_struct, is_union| {
388
390
match ty {
389
391
// Just pass all these through, no need for a "struct" prefix
390
- "FILE" | "DIR" | "Dl_info" => ty. to_string ( ) ,
392
+ "FILE" | "DIR" | "Dl_info" | "Elf32_Phdr" | "Elf64_Phdr" => {
393
+ ty. to_string ( )
394
+ }
391
395
392
396
// OSX calls this something else
393
397
"sighandler_t" => "sig_t" . to_string ( ) ,
@@ -418,6 +422,15 @@ fn test_openbsd(target: &str) {
418
422
struct_ == "siginfo_t" && field == "si_addr"
419
423
} ) ;
420
424
425
+ cfg. skip_field ( |struct_, field| {
426
+ match ( struct_, field) {
427
+ // conflicting with `p_type` macro from <resolve.h>.
428
+ ( "Elf32_Phdr" , "p_type" ) => true ,
429
+ ( "Elf64_Phdr" , "p_type" ) => true ,
430
+ _ => false ,
431
+ }
432
+ } ) ;
433
+
421
434
cfg. generate ( "../src/lib.rs" , "main.rs" ) ;
422
435
}
423
436
@@ -870,9 +883,11 @@ fn test_netbsd(target: &str) {
870
883
871
884
headers ! {
872
885
cfg:
886
+ "elf.h" ,
873
887
"errno.h" ,
874
888
"fcntl.h" ,
875
889
"limits.h" ,
890
+ "link.h" ,
876
891
"locale.h" ,
877
892
"stddef.h" ,
878
893
"stdint.h" ,
@@ -1061,6 +1076,15 @@ fn test_netbsd(target: &str) {
1061
1076
( struct_ == "aiocb" && field == "aio_buf" )
1062
1077
} ) ;
1063
1078
1079
+ cfg. skip_field ( |struct_, field| {
1080
+ match ( struct_, field) {
1081
+ // conflicting with `p_type` macro from <resolve.h>.
1082
+ ( "Elf32_Phdr" , "p_type" ) => true ,
1083
+ ( "Elf64_Phdr" , "p_type" ) => true ,
1084
+ _ => false ,
1085
+ }
1086
+ } ) ;
1087
+
1064
1088
cfg. generate ( "../src/lib.rs" , "main.rs" ) ;
1065
1089
}
1066
1090
@@ -1633,6 +1657,7 @@ fn test_freebsd(target: &str) {
1633
1657
"ctype.h" ,
1634
1658
"dirent.h" ,
1635
1659
"dlfcn.h" ,
1660
+ "elf.h" ,
1636
1661
"errno.h" ,
1637
1662
"fcntl.h" ,
1638
1663
"glob.h" ,
@@ -1641,6 +1666,7 @@ fn test_freebsd(target: &str) {
1641
1666
"langinfo.h" ,
1642
1667
"libutil.h" ,
1643
1668
"limits.h" ,
1669
+ "link.h" ,
1644
1670
"locale.h" ,
1645
1671
"machine/reg.h" ,
1646
1672
"mqueue.h" ,
@@ -1709,7 +1735,8 @@ fn test_freebsd(target: &str) {
1709
1735
cfg. type_name ( move |ty, is_struct, is_union| {
1710
1736
match ty {
1711
1737
// Just pass all these through, no need for a "struct" prefix
1712
- "FILE" | "fd_set" | "Dl_info" | "DIR" => ty. to_string ( ) ,
1738
+ "FILE" | "fd_set" | "Dl_info" | "DIR" | "Elf32_Phdr"
1739
+ | "Elf64_Phdr" => ty. to_string ( ) ,
1713
1740
1714
1741
// FIXME: https://github.com/rust-lang/libc/issues/1273
1715
1742
"sighandler_t" => "sig_t" . to_string ( ) ,
@@ -1909,6 +1936,10 @@ fn test_freebsd(target: &str) {
1909
1936
// `void*`:
1910
1937
( "stack_t" , "ss_sp" ) if Some ( 10 ) == freebsd_ver => true ,
1911
1938
1939
+ // conflicting with `p_type` macro from <resolve.h>.
1940
+ ( "Elf32_Phdr" , "p_type" ) => true ,
1941
+ ( "Elf64_Phdr" , "p_type" ) => true ,
1942
+
1912
1943
_ => false ,
1913
1944
}
1914
1945
} ) ;
0 commit comments