Skip to content
Snippets Groups Projects
Commit 3db0588d authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Merge branch 'ctime_r' into 'master'

added ctime_r

See merge request !250
parents 631fd4f0 278a70c8
No related branches found
No related tags found
1 merge request!250added ctime_r
Pipeline #6578 failed
...@@ -138,11 +138,14 @@ pub unsafe extern "C" fn ctime(clock: *const time_t) -> *mut c_char { ...@@ -138,11 +138,14 @@ pub unsafe extern "C" fn ctime(clock: *const time_t) -> *mut c_char {
asctime(localtime(clock)) asctime(localtime(clock))
} }
// #[no_mangle] #[no_mangle]
pub extern "C" fn ctime_r(clock: *const time_t, buf: *mut c_char) -> *mut c_char { pub unsafe extern "C" fn ctime_r(clock: *const time_t, buf: *mut c_char) -> *mut c_char {
unimplemented!(); let mut tm1 : tm = core::mem::uninitialized();
localtime_r(clock, &mut tm1);
asctime_r(&mut tm1, buf)
} }
#[no_mangle] #[no_mangle]
pub extern "C" fn difftime(time1: time_t, time0: time_t) -> c_double { pub extern "C" fn difftime(time1: time_t, time0: time_t) -> c_double {
(time1 - time0) as c_double (time1 - time0) as c_double
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment