Add the few last things to get gcc_complete working

This commit is contained in:
jD91mZM2
2018-06-25 11:43:44 +02:00
parent 320eb0ecd0
commit 441bf9f00b
9 changed files with 52 additions and 17 deletions
+7 -3
View File
@@ -620,7 +620,11 @@ macro_rules! strto_impl {
let set_endptr = |idx: isize| {
if !$endptr.is_null() {
*$endptr = $s.offset(idx);
// This is stupid, but apparently strto* functions want
// const input but mut output, yet the man page says
// "stores the address of the first invalid character in *endptr"
// so obviously it doesn't want us to clone it.
*$endptr = $s.offset(idx) as *mut _;
}
};
@@ -712,7 +716,7 @@ macro_rules! strto_impl {
#[no_mangle]
pub unsafe extern "C" fn strtoul(s: *const c_char,
endptr: *mut *const c_char,
endptr: *mut *mut c_char,
base: c_int)
-> c_ulong {
strto_impl!(
@@ -728,7 +732,7 @@ pub unsafe extern "C" fn strtoul(s: *const c_char,
#[no_mangle]
pub unsafe extern "C" fn strtol(s: *const c_char,
endptr: *mut *const c_char,
endptr: *mut *mut c_char,
base: c_int)
-> c_long {
strto_impl!(