|
1 | 1 | #![cfg(not(test))]
|
2 | 2 |
|
3 |
| -use libc::{c_double, c_float}; |
| 3 | +// These symbols are all defined by `libm`, |
| 4 | +// or by `compiler-builtins` on unsupported platforms. |
4 | 5 |
|
5 | 6 | extern "C" {
|
6 |
| - pub fn acos(n: c_double) -> c_double; |
7 |
| - pub fn acosf(n: c_float) -> c_float; |
8 |
| - pub fn asin(n: c_double) -> c_double; |
9 |
| - pub fn asinf(n: c_float) -> c_float; |
10 |
| - pub fn atan(n: c_double) -> c_double; |
11 |
| - pub fn atan2(a: c_double, b: c_double) -> c_double; |
12 |
| - pub fn atan2f(a: c_float, b: c_float) -> c_float; |
13 |
| - pub fn atanf(n: c_float) -> c_float; |
14 |
| - pub fn cbrt(n: c_double) -> c_double; |
15 |
| - pub fn cbrtf(n: c_float) -> c_float; |
16 |
| - pub fn cosh(n: c_double) -> c_double; |
17 |
| - pub fn coshf(n: c_float) -> c_float; |
18 |
| - pub fn expm1(n: c_double) -> c_double; |
19 |
| - pub fn expm1f(n: c_float) -> c_float; |
20 |
| - pub fn fdim(a: c_double, b: c_double) -> c_double; |
21 |
| - pub fn fdimf(a: c_float, b: c_float) -> c_float; |
22 |
| - pub fn hypot(x: c_double, y: c_double) -> c_double; |
23 |
| - pub fn hypotf(x: c_float, y: c_float) -> c_float; |
24 |
| - pub fn log1p(n: c_double) -> c_double; |
25 |
| - pub fn log1pf(n: c_float) -> c_float; |
26 |
| - pub fn sinh(n: c_double) -> c_double; |
27 |
| - pub fn sinhf(n: c_float) -> c_float; |
28 |
| - pub fn tan(n: c_double) -> c_double; |
29 |
| - pub fn tanf(n: c_float) -> c_float; |
30 |
| - pub fn tanh(n: c_double) -> c_double; |
31 |
| - pub fn tanhf(n: c_float) -> c_float; |
| 7 | + pub fn acos(n: f64) -> f64; |
| 8 | + pub fn acosf(n: f32) -> f32; |
| 9 | + pub fn asin(n: f64) -> f64; |
| 10 | + pub fn asinf(n: f32) -> f32; |
| 11 | + pub fn atan(n: f64) -> f64; |
| 12 | + pub fn atan2(a: f64, b: f64) -> f64; |
| 13 | + pub fn atan2f(a: f32, b: f32) -> f32; |
| 14 | + pub fn atanf(n: f32) -> f32; |
| 15 | + pub fn cbrt(n: f64) -> f64; |
| 16 | + pub fn cbrtf(n: f32) -> f32; |
| 17 | + pub fn cosh(n: f64) -> f64; |
| 18 | + pub fn coshf(n: f32) -> f32; |
| 19 | + pub fn expm1(n: f64) -> f64; |
| 20 | + pub fn expm1f(n: f32) -> f32; |
| 21 | + pub fn fdim(a: f64, b: f64) -> f64; |
| 22 | + pub fn fdimf(a: f32, b: f32) -> f32; |
| 23 | + pub fn hypot(x: f64, y: f64) -> f64; |
| 24 | + pub fn hypotf(x: f32, y: f32) -> f32; |
| 25 | + pub fn log1p(n: f64) -> f64; |
| 26 | + pub fn log1pf(n: f32) -> f32; |
| 27 | + pub fn sinh(n: f64) -> f64; |
| 28 | + pub fn sinhf(n: f32) -> f32; |
| 29 | + pub fn tan(n: f64) -> f64; |
| 30 | + pub fn tanf(n: f32) -> f32; |
| 31 | + pub fn tanh(n: f64) -> f64; |
| 32 | + pub fn tanhf(n: f32) -> f32; |
32 | 33 | }
|
0 commit comments