Add the last few things for bash to compile :D
This commit is contained in:
@@ -8,5 +8,6 @@ build = "build.rs"
|
||||
cbindgen = { path = "../../cbindgen" }
|
||||
|
||||
[dependencies]
|
||||
platform = { path = "../platform" }
|
||||
errno = { path = "../errno" }
|
||||
platform = { path = "../platform" }
|
||||
signal = { path = "../signal" }
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
extern crate errno;
|
||||
extern crate platform;
|
||||
extern crate signal;
|
||||
|
||||
use core::cmp;
|
||||
use core::mem;
|
||||
@@ -308,6 +309,13 @@ pub unsafe extern "C" fn strrchr(s: *const c_char, c: c_int) -> *mut c_char {
|
||||
ptr::null_mut()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn strsignal(sig: c_int) -> *mut c_char {
|
||||
// Mutating this is undefined behavior I believe. But I just can't create a
|
||||
// &'static mut str. Alternative is allocating everything on the heap...
|
||||
signal::_signal_strings[sig as usize].as_ptr() as *const c_char as *mut c_char
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn strspn(s1: *const c_char, s2: *const c_char) -> size_t {
|
||||
let s1 = s1 as *const u8;
|
||||
|
||||
Reference in New Issue
Block a user