From efaa43ade5cbc6636c955581384324c8f7ace940 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 26 Dec 2014 23:28:04 +0100 Subject: [PATCH] liballoc's "external_funcs" and "external_crate" are now features This allows the vanilla libary to built for kernel use with Cargo. --- src/liballoc/heap.rs | 10 +++++----- src/liballoc/lib.rs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/liballoc/heap.rs b/src/liballoc/heap.rs index c57435cdc8c0..1df065205499 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 3de77b052283..72509d34f29d 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