|
@@ -75,11 +75,7 @@ pub unsafe extern "C" fn abort() {
|
|
|
|
|
|
#[no_mangle]
|
|
|
pub extern "C" fn abs(i: c_int) -> c_int {
|
|
|
- if i < 0 {
|
|
|
- -i
|
|
|
- } else {
|
|
|
- i
|
|
|
- }
|
|
|
+ i.abs()
|
|
|
}
|
|
|
|
|
|
#[no_mangle]
|
|
@@ -331,11 +327,7 @@ pub extern "C" fn l64a(value: c_long) -> *mut c_char {
|
|
|
|
|
|
#[no_mangle]
|
|
|
pub extern "C" fn labs(i: c_long) -> c_long {
|
|
|
- if i < 0 {
|
|
|
- -i
|
|
|
- } else {
|
|
|
- i
|
|
|
- }
|
|
|
+ i.abs()
|
|
|
}
|
|
|
|
|
|
// #[no_mangle]
|
|
@@ -362,6 +354,11 @@ pub extern "C" fn lrand48() -> c_long {
|
|
|
unimplemented!();
|
|
|
}
|
|
|
|
|
|
+#[no_mangle]
|
|
|
+pub extern "C" fn llabs(i: c_longlong) -> c_longlong {
|
|
|
+ i.abs()
|
|
|
+}
|
|
|
+
|
|
|
#[no_mangle]
|
|
|
pub unsafe extern "C" fn malloc(size: size_t) -> *mut c_void {
|
|
|
platform::alloc(size)
|