|
5 | 5 |
|
6 | 6 | extern crate libc;
|
7 | 7 |
|
8 |
| -#[cfg(target_os = "linux, freebsd")] |
| 8 | +#[cfg(any(target_os = "linux", target_os = "freebsd"))] |
9 | 9 | fn tmp() -> std::path::PathBuf {
|
10 | 10 | std::env::var("MIRI_TEMP").map(std::path::PathBuf::from).unwrap_or_else(|_| std::env::temp_dir())
|
11 | 11 | }
|
12 | 12 |
|
13 |
| -#[cfg(target_os = "linux, freebsd")] |
| 13 | +#[cfg(any(target_os = "linux", target_os = "freebsd"))] |
14 | 14 | fn test_posix_fadvise() {
|
15 | 15 | use std::convert::TryInto;
|
16 | 16 | use std::fs::{remove_file, File};
|
@@ -40,7 +40,7 @@ fn test_posix_fadvise() {
|
40 | 40 | assert_eq!(result, 0);
|
41 | 41 | }
|
42 | 42 |
|
43 |
| -#[cfg(target_os = "linux, freebsd")] |
| 43 | +#[cfg(any(target_os = "linux", target_os = "freebsd"))] |
44 | 44 | fn test_sync_file_range() {
|
45 | 45 | use std::fs::{remove_file, File};
|
46 | 46 | use std::io::Write;
|
@@ -191,7 +191,7 @@ fn test_rwlock_libc_static_initializer() {
|
191 | 191 | /// Test whether the `prctl` shim correctly sets the thread name.
|
192 | 192 | ///
|
193 | 193 | /// Note: `prctl` exists only on Linux.
|
194 |
| -#[cfg(target_os = "linux,freebsd")] |
| 194 | +#[cfg(any(target_os = "linux", target_os = "freebsd"))] |
195 | 195 | fn test_prctl_thread_name() {
|
196 | 196 | use std::ffi::CString;
|
197 | 197 | use libc::c_long;
|
@@ -231,7 +231,7 @@ fn test_thread_local_errno() {
|
231 | 231 | }
|
232 | 232 |
|
233 | 233 | /// Tests whether clock support exists at all
|
234 |
| -#[cfg(target_os = "linux,freebsd")] |
| 234 | +#[cfg(any(target_os = "linux", target_os = "freebsd"))] |
235 | 235 | fn test_clocks() {
|
236 | 236 | let mut tp = std::mem::MaybeUninit::<libc::timespec>::uninit();
|
237 | 237 | let is_error = unsafe {
|
@@ -260,25 +260,25 @@ fn test_getpid() {
|
260 | 260 | }
|
261 | 261 |
|
262 | 262 | fn main() {
|
263 |
| - #[cfg(target_os = "linux,freebsd")] |
| 263 | + #[cfg(any(target_os = "linux", target_os = "freebsd"))] |
264 | 264 | test_posix_fadvise();
|
265 | 265 |
|
266 |
| - #[cfg(target_os = "linux,freebsd")] |
| 266 | + #[cfg(any(target_os = "linux", target_os = "freebsd"))] |
267 | 267 | test_sync_file_range();
|
268 | 268 |
|
269 | 269 | test_mutex_libc_init_recursive();
|
270 | 270 | test_mutex_libc_init_normal();
|
271 | 271 | test_mutex_libc_init_errorcheck();
|
272 | 272 | test_rwlock_libc_static_initializer();
|
273 | 273 |
|
274 |
| - #[cfg(target_os = "linux,freebsd")] |
| 274 | + #[cfg(any(target_os = "linux", target_os = "freebsd"))] |
275 | 275 | test_mutex_libc_static_initializer_recursive();
|
276 | 276 |
|
277 |
| - #[cfg(target_os = "linux,freebsd")] |
| 277 | + #[cfg(any(target_os = "linux", target_os = "freebsd"))] |
278 | 278 | test_prctl_thread_name();
|
279 | 279 |
|
280 | 280 | test_thread_local_errno();
|
281 | 281 |
|
282 |
| - #[cfg(target_os = "linux,freebsd")] |
| 282 | + #[cfg(any(target_os = "linux", target_os = "freebsd"))] |
283 | 283 | test_clocks();
|
284 | 284 | }
|
0 commit comments