|
@@ -99,7 +99,7 @@ mod tests {
|
|
|
use qc::{U32, U64};
|
|
|
|
|
|
check! {
|
|
|
- fn __divdi3(f: extern fn(i64, i64) -> i64, n: U64, d: U64) -> Option<i64> {
|
|
|
+ fn __divdi3(f: extern "C" fn(i64, i64) -> i64, n: U64, d: U64) -> Option<i64> {
|
|
|
let (n, d) = (n.0 as i64, d.0 as i64);
|
|
|
if d == 0 {
|
|
|
None
|
|
@@ -108,7 +108,7 @@ mod tests {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- fn __moddi3(f: extern fn(i64, i64) -> i64, n: U64, d: U64) -> Option<i64> {
|
|
|
+ fn __moddi3(f: extern "C" fn(i64, i64) -> i64, n: U64, d: U64) -> Option<i64> {
|
|
|
let (n, d) = (n.0 as i64, d.0 as i64);
|
|
|
if d == 0 {
|
|
|
None
|
|
@@ -117,7 +117,8 @@ mod tests {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- fn __divmoddi4(f: extern fn(i64, i64, &mut i64) -> i64,
|
|
|
+ #[cfg(target_arch = "arm")]
|
|
|
+ fn __divmoddi4(f: extern "aapcs" fn(i64, i64, &mut i64) -> i64,
|
|
|
n: U64,
|
|
|
d: U64) -> Option<(i64, i64)> {
|
|
|
let (n, d) = (n.0 as i64, d.0 as i64);
|
|
@@ -130,7 +131,21 @@ mod tests {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- fn __divsi3(f: extern fn(i32, i32) -> i32,
|
|
|
+ #[cfg(not(target_arch = "arm"))]
|
|
|
+ fn __divmoddi4(f: extern "C" fn(i64, i64, &mut i64) -> i64,
|
|
|
+ n: U64,
|
|
|
+ d: U64) -> Option<(i64, i64)> {
|
|
|
+ let (n, d) = (n.0 as i64, d.0 as i64);
|
|
|
+ if d == 0 {
|
|
|
+ None
|
|
|
+ } else {
|
|
|
+ let mut r = 0;
|
|
|
+ let q = f(n, d, &mut r);
|
|
|
+ Some((q, r))
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ fn __divsi3(f: extern "C" fn(i32, i32) -> i32,
|
|
|
n: U32,
|
|
|
d: U32) -> Option<i32> {
|
|
|
let (n, d) = (n.0 as i32, d.0 as i32);
|
|
@@ -141,7 +156,7 @@ mod tests {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- fn __modsi3(f: extern fn(i32, i32) -> i32,
|
|
|
+ fn __modsi3(f: extern "C" fn(i32, i32) -> i32,
|
|
|
n: U32,
|
|
|
d: U32) -> Option<i32> {
|
|
|
let (n, d) = (n.0 as i32, d.0 as i32);
|
|
@@ -152,7 +167,7 @@ mod tests {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- fn __divmodsi4(f: extern fn(i32, i32, &mut i32) -> i32,
|
|
|
+ fn __divmodsi4(f: extern "C" fn(i32, i32, &mut i32) -> i32,
|
|
|
n: U32,
|
|
|
d: U32) -> Option<(i32, i32)> {
|
|
|
let (n, d) = (n.0 as i32, d.0 as i32);
|
|
@@ -176,7 +191,7 @@ mod tests_i128 {
|
|
|
use qc::U128;
|
|
|
check! {
|
|
|
|
|
|
- fn __divti3(f: extern fn(i128, i128) -> i128, n: U128, d: U128) -> Option<i128> {
|
|
|
+ fn __divti3(f: extern "C" fn(i128, i128) -> i128, n: U128, d: U128) -> Option<i128> {
|
|
|
let (n, d) = (n.0 as i128, d.0 as i128);
|
|
|
if d == 0 {
|
|
|
None
|
|
@@ -185,7 +200,7 @@ mod tests_i128 {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- fn __modti3(f: extern fn(i128, i128) -> i128, n: U128, d: U128) -> Option<i128> {
|
|
|
+ fn __modti3(f: extern "C" fn(i128, i128) -> i128, n: U128, d: U128) -> Option<i128> {
|
|
|
let (n, d) = (n.0 as i128, d.0 as i128);
|
|
|
if d == 0 {
|
|
|
None
|