@@ -51,44 +51,22 @@ pub use crate::sys_common::fs::remove_dir_all;
51
51
52
52
pub struct File ( FileDesc ) ;
53
53
54
- // FIXME: This should be available on Linux with all `target_arch` and `target_env`.
55
- // https://github.com/rust-lang/libc/issues/1545
54
+ // FIXME: This should be available on Linux with all `target_env`.
55
+ // But currently only glibc exposes `statx` fn and structs.
56
+ // We don't want to import unverified raw C structs here directly.
57
+ // https://github.com/rust-lang/rust/pull/67774
56
58
macro_rules! cfg_has_statx {
57
59
( { $( $then_tt: tt) * } else { $( $else_tt: tt) * } ) => {
58
60
cfg_if:: cfg_if! {
59
- if #[ cfg( all( target_os = "linux" , target_env = "gnu" , any(
60
- target_arch = "x86" ,
61
- target_arch = "arm" ,
62
- // target_arch = "mips",
63
- target_arch = "powerpc" ,
64
- target_arch = "x86_64" ,
65
- // target_arch = "aarch64",
66
- target_arch = "powerpc64" ,
67
- // target_arch = "mips64",
68
- // target_arch = "s390x",
69
- target_arch = "sparc64" ,
70
- target_arch = "riscv64" ,
71
- ) ) ) ] {
61
+ if #[ cfg( all( target_os = "linux" , target_env = "gnu" ) ) ] {
72
62
$( $then_tt) *
73
63
} else {
74
64
$( $else_tt) *
75
65
}
76
66
}
77
67
} ;
78
68
( $( $block_inner: tt) * ) => {
79
- #[ cfg( all( target_os = "linux" , target_env = "gnu" , any(
80
- target_arch = "x86" ,
81
- target_arch = "arm" ,
82
- // target_arch = "mips",
83
- target_arch = "powerpc" ,
84
- target_arch = "x86_64" ,
85
- // target_arch = "aarch64",
86
- target_arch = "powerpc64" ,
87
- // target_arch = "mips64",
88
- // target_arch = "s390x",
89
- target_arch = "sparc64" ,
90
- target_arch = "riscv64" ,
91
- ) ) ) ]
69
+ #[ cfg( all( target_os = "linux" , target_env = "gnu" ) ) ]
92
70
{
93
71
$( $block_inner) *
94
72
}
0 commit comments