about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTatsuyuki Ishi <ishitatsuyuki@gmail.com>2017-08-23 09:57:05 +0900
committerTatsuyuki Ishi <ishitatsuyuki@gmail.com>2017-08-27 19:02:24 +0900
commit7a8d38e522b77cb21d38919e6d9ce1b8480cfca0 (patch)
tree003077953992976f323e4695e49319f23e19b4db
parent7f054990b6bb19e15750a4442a24941cc157acb6 (diff)
downloadrust-7a8d38e522b77cb21d38919e6d9ce1b8480cfca0.tar.gz
rust-7a8d38e522b77cb21d38919e6d9ce1b8480cfca0.zip
Additional libc cleanup
-rw-r--r--src/librustc_driver/lib.rs3
-rw-r--r--src/librustc_errors/lib.rs3
-rw-r--r--src/tools/compiletest/src/main.rs1
3 files changed, 5 insertions, 2 deletions
diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs
index e56c989b843..1915a1c8648 100644
--- a/src/librustc_driver/lib.rs
+++ b/src/librustc_driver/lib.rs
@@ -20,7 +20,7 @@
 #![deny(warnings)]
 
 #![feature(box_syntax)]
-#![feature(libc)]
+#![cfg_attr(unix, feature(libc))]
 #![feature(quote)]
 #![feature(rustc_diagnostic_macros)]
 #![feature(set_stdio)]
@@ -29,6 +29,7 @@ extern crate arena;
 extern crate getopts;
 extern crate graphviz;
 extern crate env_logger;
+#[cfg(unix)]
 extern crate libc;
 extern crate rustc;
 extern crate rustc_allocator;
diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs
index 2f5aac65b92..870bb01bb9f 100644
--- a/src/librustc_errors/lib.rs
+++ b/src/librustc_errors/lib.rs
@@ -16,10 +16,11 @@
 #![feature(custom_attribute)]
 #![allow(unused_attributes)]
 #![feature(range_contains)]
-#![feature(libc)]
+#![cfg_attr(unix, feature(libc))]
 #![feature(conservative_impl_trait)]
 
 extern crate term;
+#[cfg(unix)]
 extern crate libc;
 extern crate serialize as rustc_serialize;
 extern crate syntax_pos;
diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs
index 20239e97478..15216f52d91 100644
--- a/src/tools/compiletest/src/main.rs
+++ b/src/tools/compiletest/src/main.rs
@@ -14,6 +14,7 @@
 
 #![deny(warnings)]
 
+#[cfg(any(target_os = "macos", target_os = "ios"))]
 extern crate libc;
 extern crate test;
 extern crate getopts;