about summary refs log tree commit diff
path: root/src/libtest/lib.rs
diff options
context:
space:
mode:
authorEd Schouten <ed@nuxi.nl>2018-01-11 11:42:33 +0100
committerEd Schouten <ed@nuxi.nl>2018-01-11 11:42:33 +0100
commit9babb8a863f3c0af7858e14e28f2a6d49e9ced44 (patch)
tree0d2d8655f9047820a87e96a4466dd531d2d342f3 /src/libtest/lib.rs
parent619ced057842a25f8700237a9c22a6f5c318a954 (diff)
downloadrust-9babb8a863f3c0af7858e14e28f2a6d49e9ced44.tar.gz
rust-9babb8a863f3c0af7858e14e28f2a6d49e9ced44.zip
Make libtest build on CloudABI.
Just like on UNIX systems, we need to use sysconf() to obtain the number
of CPUs. Extend the existing cfg()'s to match CloudABI as well.
Diffstat (limited to 'src/libtest/lib.rs')
-rw-r--r--src/libtest/lib.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs
index 76557982a02..f7880d3c4d8 100644
--- a/src/libtest/lib.rs
+++ b/src/libtest/lib.rs
@@ -36,14 +36,14 @@
 
 #![feature(asm)]
 #![feature(fnbox)]
-#![cfg_attr(unix, feature(libc))]
+#![cfg_attr(any(unix, target_os = "cloudabi"), feature(libc))]
 #![feature(set_stdio)]
 #![feature(panic_unwind)]
 #![feature(staged_api)]
 
 extern crate getopts;
 extern crate term;
-#[cfg(unix)]
+#[cfg(any(unix, target_os = "cloudabi"))]
 extern crate libc;
 extern crate panic_unwind;
 
@@ -1191,13 +1191,14 @@ fn get_concurrency() -> usize {
         1
     }
 
-    #[cfg(any(target_os = "linux",
-              target_os = "macos",
-              target_os = "ios",
-              target_os = "android",
-              target_os = "solaris",
+    #[cfg(any(target_os = "android",
+              target_os = "cloudabi",
               target_os = "emscripten",
-              target_os = "fuchsia"))]
+              target_os = "fuchsia",
+              target_os = "ios",
+              target_os = "linux",
+              target_os = "macos",
+              target_os = "solaris"))]
     fn num_cpus() -> usize {
         unsafe { libc::sysconf(libc::_SC_NPROCESSORS_ONLN) as usize }
     }