Skip to content

Commit efaa43a

Browse files
committed
liballoc's "external_funcs" and "external_crate" are now features
This allows the vanilla libary to built for kernel use with Cargo.
1 parent f67a722 commit efaa43a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/liballoc/heap.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ const MIN_ALIGN: uint = 8;
124124
target_arch = "aarch64"))]
125125
const MIN_ALIGN: uint = 16;
126126

127-
#[cfg(external_funcs)]
127+
#[cfg(feature = "external_funcs")]
128128
mod imp {
129129
extern {
130130
fn rust_allocate(size: uint, align: uint) -> *mut u8;
@@ -169,14 +169,14 @@ mod imp {
169169
}
170170
}
171171

172-
#[cfg(external_crate)]
172+
#[cfg(feature = "external_crate")]
173173
mod imp {
174174
extern crate external;
175175
pub use self::external::{allocate, deallocate, reallocate_inplace, reallocate};
176176
pub use self::external::{usable_size, stats_print};
177177
}
178178

179-
#[cfg(all(not(external_funcs), not(external_crate), jemalloc))]
179+
#[cfg(all(not(feature = "external_funcs"), not(feature = "external_crate"), jemalloc))]
180180
mod imp {
181181
use core::option::Option;
182182
use core::option::Option::None;
@@ -253,7 +253,7 @@ mod imp {
253253
}
254254
}
255255

256-
#[cfg(all(not(external_funcs), not(external_crate), not(jemalloc), unix))]
256+
#[cfg(all(not(feature = "external_funcs"), not(feature = "external_crate"), not(jemalloc), unix))]
257257
mod imp {
258258
use core::cmp;
259259
use core::ptr;
@@ -314,7 +314,7 @@ mod imp {
314314
pub fn stats_print() {}
315315
}
316316

317-
#[cfg(all(not(external_funcs), not(external_crate), not(jemalloc), windows))]
317+
#[cfg(all(not(feature = "external_funcs"), not(feature = "external_crate"), not(jemalloc), windows))]
318318
mod imp {
319319
use libc::{c_void, size_t};
320320
use libc;

src/liballoc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
#[macro_use]
7171
extern crate core;
7272

73-
#[cfg(all(not(external_funcs), not(external_crate)))]
73+
#[cfg(all(not(feature = "external_funcs"), not(feature = "external_crate")))]
7474
extern crate libc;
7575

7676
// Allow testing this library

0 commit comments

Comments
 (0)