Fix compilation on Redox
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
#![no_std]
|
||||
#![allow(non_camel_case_types)]
|
||||
#![feature(alloc)]
|
||||
#![feature(allocator_api)]
|
||||
//TODO #![feature(thread_local)]
|
||||
|
||||
extern crate alloc;
|
||||
|
||||
#[cfg(all(not(feature = "no_std"), target_os = "linux"))]
|
||||
#[macro_use]
|
||||
extern crate sc;
|
||||
@@ -11,15 +14,15 @@ extern crate sc;
|
||||
#[macro_use]
|
||||
pub extern crate syscall;
|
||||
|
||||
pub use alloc::*;
|
||||
pub use allocator::*;
|
||||
|
||||
#[cfg(not(feature = "ralloc"))]
|
||||
#[path = "alloc/dlmalloc.rs"]
|
||||
mod alloc;
|
||||
#[path = "allocator/dlmalloc.rs"]
|
||||
mod allocator;
|
||||
|
||||
#[cfg(feature = "ralloc")]
|
||||
#[path = "alloc/ralloc.rs"]
|
||||
mod alloc;
|
||||
#[path = "allocator/ralloc.rs"]
|
||||
mod allocator;
|
||||
|
||||
pub use sys::*;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ pub fn e(sys: Result<usize, syscall::Error>) -> usize {
|
||||
}
|
||||
|
||||
pub fn brk(addr: *mut c_void) -> *mut c_void {
|
||||
unsafe { syscall::brk(addr as usize) } as *mut c_void
|
||||
unsafe { syscall::brk(addr as usize).unwrap_or(0) as *mut c_void }
|
||||
}
|
||||
|
||||
pub fn chdir(path: *const c_char) -> c_int {
|
||||
|
||||
Reference in New Issue
Block a user