about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@Yahoo.com>2014-12-26 23:28:04 +0100
committerJohn Ericson <Ericson2314@Yahoo.com>2015-01-07 19:19:00 +0000
commitefaa43ade5cbc6636c955581384324c8f7ace940 (patch)
treee064366cc43426f1d39782da9d16b38655bab7f6 /src/liballoc
parentf67a7227b7052608a23d1e324c29f8ec6addf58a (diff)
downloadrust-efaa43ade5cbc6636c955581384324c8f7ace940.tar.gz
rust-efaa43ade5cbc6636c955581384324c8f7ace940.zip
liballoc's "external_funcs" and "external_crate" are now features
This allows the vanilla libary to built for kernel use with Cargo.
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/heap.rs10
-rw-r--r--src/liballoc/lib.rs2
2 files changed, 6 insertions, 6 deletions
diff --git a/src/liballoc/heap.rs b/src/liballoc/heap.rs
index c57435cdc8c..1df06520549 100644
--- a/src/liballoc/heap.rs
+++ b/src/liballoc/heap.rs
@@ -124,7 +124,7 @@ const MIN_ALIGN: uint = 8;
           target_arch = "aarch64"))]
 const MIN_ALIGN: uint = 16;
 
-#[cfg(external_funcs)]
+#[cfg(feature = "external_funcs")]
 mod imp {
     extern {
         fn rust_allocate(size: uint, align: uint) -> *mut u8;
@@ -169,14 +169,14 @@ mod imp {
     }
 }
 
-#[cfg(external_crate)]
+#[cfg(feature = "external_crate")]
 mod imp {
     extern crate external;
     pub use self::external::{allocate, deallocate, reallocate_inplace, reallocate};
     pub use self::external::{usable_size, stats_print};
 }
 
-#[cfg(all(not(external_funcs), not(external_crate), jemalloc))]
+#[cfg(all(not(feature = "external_funcs"), not(feature = "external_crate"), jemalloc))]
 mod imp {
     use core::option::Option;
     use core::option::Option::None;
@@ -253,7 +253,7 @@ mod imp {
     }
 }
 
-#[cfg(all(not(external_funcs), not(external_crate), not(jemalloc), unix))]
+#[cfg(all(not(feature = "external_funcs"), not(feature = "external_crate"), not(jemalloc), unix))]
 mod imp {
     use core::cmp;
     use core::ptr;
@@ -314,7 +314,7 @@ mod imp {
     pub fn stats_print() {}
 }
 
-#[cfg(all(not(external_funcs), not(external_crate), not(jemalloc), windows))]
+#[cfg(all(not(feature = "external_funcs"), not(feature = "external_crate"), not(jemalloc), windows))]
 mod imp {
     use libc::{c_void, size_t};
     use libc;
diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs
index 3de77b05228..72509d34f29 100644
--- a/src/liballoc/lib.rs
+++ b/src/liballoc/lib.rs
@@ -70,7 +70,7 @@
 #[macro_use]
 extern crate core;
 
-#[cfg(all(not(external_funcs), not(external_crate)))]
+#[cfg(all(not(feature = "external_funcs"), not(feature = "external_crate")))]
 extern crate libc;
 
 // Allow testing this library