1 // ignore-wasm32-bare no libc to test with
4 #![feature(rustc_private)]
11 use libc
::{c_char, c_long, c_longlong}
;
14 pub fn atol(x
: *const c_char
) -> c_long
;
15 pub fn atoll(x
: *const c_char
) -> c_longlong
;
19 fn atol(s
: String
) -> isize {
20 let c
= CString
::new(s
).unwrap();
21 unsafe { mlibc::atol(c.as_ptr()) as isize }
24 fn atoll(s
: String
) -> i64 {
25 let c
= CString
::new(s
).unwrap();
26 unsafe { mlibc::atoll(c.as_ptr()) as i64 }
30 assert_eq
!(atol("1024".to_string()) * 10, atol("10240".to_string()));
31 assert_eq
!((atoll("11111111111111111".to_string()) * 10),
32 atoll("111111111111111110".to_string()));