@@ -1323,18 +1323,15 @@ fn test_android(target: &str) {
1323
1323
// generate the error 'Your time_t is already 64-bit'
1324
1324
cfg. header ( "time64.h" ) ;
1325
1325
}
1326
+
1326
1327
if x86 {
1327
1328
cfg. header ( "sys/reg.h" ) ;
1328
1329
}
1329
1330
1330
1331
cfg. type_name ( move |ty, is_struct, is_union| {
1331
1332
match ty {
1332
1333
// Just pass all these through, no need for a "struct" prefix
1333
- // FIXME: still required ?
1334
- "FILE" | "fd_set" | "Dl_info" | "DIR" | "Elf32_Phdr"
1335
- | "Elf64_Phdr" | "Elf32_Shdr" | "Elf64_Shdr" | "Elf32_Sym"
1336
- | "Elf64_Sym" | "Elf32_Ehdr" | "Elf64_Ehdr" | "Elf32_Chdr"
1337
- | "Elf64_Chdr" => ty. to_string ( ) ,
1334
+ "FILE" | "fd_set" | "Dl_info" => ty. to_string ( ) ,
1338
1335
1339
1336
t if is_union => format ! ( "union {}" , t) ,
1340
1337
@@ -1382,7 +1379,6 @@ fn test_android(target: &str) {
1382
1379
1383
1380
// These are tested as part of the linux_fcntl tests since there are
1384
1381
// header conflicts when including them with all the other structs.
1385
- // FIXME: still necessary
1386
1382
"termios2" => true ,
1387
1383
1388
1384
_ => false ,
@@ -1406,37 +1402,6 @@ fn test_android(target: &str) {
1406
1402
// FIXME: still necessary?
1407
1403
"SIGUNUSED" => true , // removed in glibc 2.26
1408
1404
1409
- // weird signed extension or something like that?
1410
- // FIXME: still necessary?
1411
- "MS_NOUSER" => true ,
1412
- // FIXME: still necessary?
1413
- "MS_RMT_MASK" => true , // updated in glibc 2.22 and musl 1.1.13
1414
-
1415
- // Android uses old kernel headers
1416
- // These are constants used in getrandom syscall
1417
- // FIXME: still necessary?
1418
- "GRND_NONBLOCK" | "GRND_RANDOM" => true ,
1419
-
1420
- // Defined by libattr not libc on linux (hard to test).
1421
- // See constant definition for more details.
1422
- // FIXME: still necessary?
1423
- "ENOATTR" => true ,
1424
-
1425
- // FIXME: still necessary?
1426
- "BOTHER" => true ,
1427
-
1428
- // MFD_HUGETLB is not available in some older libc versions on the CI builders. On the
1429
- // x86_64 and i686 builders it seems to be available for all targets, so at least test
1430
- // it there.
1431
- // FIXME: still necessary?
1432
- "MFD_HUGETLB" => true ,
1433
-
1434
- // These change all the time from release to release of linux
1435
- // distros, let's just not bother trying to verify them. They
1436
- // shouldn't be used in code anyway...
1437
- // FIXME: still necessary?
1438
- "AF_MAX" | "PF_MAX" => true ,
1439
-
1440
1405
_ => false ,
1441
1406
}
1442
1407
} ) ;
@@ -1459,9 +1424,6 @@ fn test_android(target: &str) {
1459
1424
// FIXME: still necessary?
1460
1425
"getdtablesize" => true ,
1461
1426
1462
- // FIXME: still necessary?
1463
- "dlerror" => true , // const-ness is added
1464
-
1465
1427
// Apparently the NDK doesn't have this defined on android, but
1466
1428
// it's in a header file?
1467
1429
// FIXME: still necessary?
@@ -1523,40 +1485,12 @@ fn test_android(target: &str) {
1523
1485
field == "ssi_arch" ) )
1524
1486
} ) ;
1525
1487
1526
- // FIXME: remove
1527
- cfg. fn_cname ( move |name, _cname| name. to_string ( ) ) ;
1528
-
1529
1488
cfg. generate ( "../src/lib.rs" , "main.rs" ) ;
1530
1489
1531
1490
// On Android also generate another script for testing linux/fcntl
1532
1491
// declarations. These cannot be tested normally because including both
1533
1492
// `linux/fcntl.h` and `fcntl.h` fails.
1534
- //
1535
- // FIXME: is still necessary?
1536
- let mut cfg = ctest:: TestGenerator :: new ( ) ;
1537
- cfg. skip_type ( |_| true )
1538
- . skip_fn ( |_| true )
1539
- . skip_static ( |_| true ) ;
1540
- cfg. header ( "linux/fcntl.h" ) ;
1541
- cfg. header ( "net/if.h" ) ;
1542
- cfg. header ( "linux/if.h" ) ;
1543
- cfg. header ( "linux/quota.h" ) ;
1544
- cfg. header ( "asm/termbits.h" ) ;
1545
- cfg. skip_const ( move |name| match name {
1546
- "F_CANCELLK" | "F_ADD_SEALS" | "F_GET_SEALS" => false ,
1547
- "F_SEAL_SEAL" | "F_SEAL_SHRINK" | "F_SEAL_GROW" | "F_SEAL_WRITE" => {
1548
- false
1549
- }
1550
- "BOTHER" => false ,
1551
- _ => true ,
1552
- } ) ;
1553
- cfg. skip_struct ( |s| s != "termios2" ) ;
1554
- cfg. type_name ( move |ty, is_struct, is_union| match ty {
1555
- t if is_struct => format ! ( "struct {}" , t) ,
1556
- t if is_union => format ! ( "union {}" , t) ,
1557
- t => t. to_string ( ) ,
1558
- } ) ;
1559
- cfg. generate ( "../src/lib.rs" , "linux_fcntl.rs" ) ;
1493
+ test_linux_termios2 ( ) ;
1560
1494
}
1561
1495
1562
1496
fn test_freebsd ( target : & str ) {
@@ -2778,29 +2712,47 @@ fn test_linux(target: &str) {
2778
2712
// On Linux also generate another script for testing linux/fcntl declarations.
2779
2713
// These cannot be tested normally because including both `linux/fcntl.h` and `fcntl.h`
2780
2714
// fails on a lot of platforms.
2715
+ test_linux_termios2 ( ) ;
2716
+
2717
+ // Test Elf64_Phdr and Elf32_Phdr
2718
+ // These types have a field called `p_type`, but including
2719
+ // "resolve.h" defines a `p_type` macro that expands to `__p_type`
2720
+ // making the tests for these fails when both are included.
2721
+ let mut cfg = ctest:: TestGenerator :: new ( ) ;
2722
+ cfg. skip_fn ( |_| true )
2723
+ . skip_const ( |_| true )
2724
+ . skip_static ( |_| true )
2725
+ . type_name ( move |ty, _is_struct, _is_union| ty. to_string ( ) ) ;
2726
+ cfg. skip_struct ( move |ty| match ty {
2727
+ "Elf64_Phdr" | "Elf32_Phdr" => false ,
2728
+ _ => true ,
2729
+ } ) ;
2730
+ cfg. skip_type ( move |ty| match ty {
2731
+ "Elf64_Phdr" | "Elf32_Phdr" => false ,
2732
+ _ => true ,
2733
+ } ) ;
2734
+ cfg. header ( "elf.h" ) ;
2735
+ cfg. generate ( "../src/lib.rs" , "linux_elf.rs" ) ;
2736
+ }
2737
+
2738
+ fn test_linux_termios2 ( ) {
2781
2739
let mut cfg = ctest:: TestGenerator :: new ( ) ;
2782
2740
cfg. skip_type ( |_| true )
2783
2741
. skip_fn ( |_| true )
2784
2742
. skip_static ( |_| true ) ;
2785
- // musl defines these directly in `fcntl.h`
2786
- if musl {
2787
- cfg. header ( "fcntl.h" ) ;
2788
- } else {
2789
- cfg. header ( "linux/fcntl.h" ) ;
2790
- }
2791
- if !musl {
2792
- cfg. header ( "net/if.h" ) ;
2793
- cfg. header ( "linux/if.h" ) ;
2743
+ headers ! {
2744
+ cfg:
2745
+ "linux/fcntl.h" ,
2746
+ "net/if.h" ,
2747
+ "linux/if.h" ,
2748
+ "linux/quota.h" ,
2749
+ "asm/termbits.h"
2794
2750
}
2795
- cfg. header ( "linux/quota.h" ) ;
2796
- cfg. header ( "asm/termbits.h" ) ;
2797
2751
cfg. skip_const ( move |name| match name {
2798
2752
"F_CANCELLK" | "F_ADD_SEALS" | "F_GET_SEALS" => false ,
2799
2753
"F_SEAL_SEAL" | "F_SEAL_SHRINK" | "F_SEAL_GROW" | "F_SEAL_WRITE" => {
2800
2754
false
2801
2755
}
2802
- "QFMT_VFS_OLD" | "QFMT_VFS_V0" | "QFMT_VFS_V1" if mips => false ,
2803
- "BOTHER" => false ,
2804
2756
_ => true ,
2805
2757
} ) ;
2806
2758
cfg. skip_struct ( |s| s != "termios2" ) ;
@@ -2810,30 +2762,4 @@ fn test_linux(target: &str) {
2810
2762
t => t. to_string ( ) ,
2811
2763
} ) ;
2812
2764
cfg. generate ( "../src/lib.rs" , "linux_fcntl.rs" ) ;
2813
-
2814
- // Test Elf64_Phdr and Elf32_Phdr
2815
- // These types have a field called `p_type`, but including
2816
- // "resolve.h" defines a `p_type` macro that expands to `__p_type`
2817
- // making the tests for these fails when both are included.
2818
- let mut cfg = ctest:: TestGenerator :: new ( ) ;
2819
- cfg. skip_fn ( |_| true )
2820
- . skip_const ( |_| true )
2821
- . skip_static ( |_| true )
2822
- . type_name ( move |ty, _is_struct, _is_union| {
2823
- ty. to_string ( )
2824
- } ) ;
2825
- cfg. skip_struct ( move |ty| {
2826
- match ty {
2827
- "Elf64_Phdr" | "Elf32_Phdr" => false ,
2828
- _ => true ,
2829
- }
2830
- } ) ;
2831
- cfg. skip_type ( move |ty| {
2832
- match ty {
2833
- "Elf64_Phdr" | "Elf32_Phdr" => false ,
2834
- _ => true ,
2835
- }
2836
- } ) ;
2837
- cfg. header ( "elf.h" ) ;
2838
- cfg. generate ( "../src/lib.rs" , "linux_elf.rs" ) ;
2839
2765
}
0 commit comments