1- // These symbols are all defined by `libm`,
2- // or by `compiler-builtins` on unsupported platforms.
1+ // Raw FFI declarations for system libm.
2+ // Only available on unix/windows where native libm exists.
3+
4+ #[ cfg( any( unix, windows) ) ]
35#[ cfg_attr( unix, link( name = "m" ) ) ]
46#[ allow( dead_code) ]
57unsafe extern "C" {
@@ -45,7 +47,6 @@ unsafe extern "C" {
4547 pub fn ceil ( n : f64 ) -> f64 ;
4648 pub fn copysign ( x : f64 , y : f64 ) -> f64 ;
4749 pub fn fabs ( n : f64 ) -> f64 ;
48- // pub fn fdim(a: f64, b: f64) -> f64;
4950 pub fn fdimf ( a : f32 , b : f32 ) -> f32 ;
5051 pub fn floor ( n : f64 ) -> f64 ;
5152 pub fn fmod ( x : f64 , y : f64 ) -> f64 ;
@@ -61,38 +62,7 @@ unsafe extern "C" {
6162 pub fn erfc ( n : f64 ) -> f64 ;
6263 pub fn erff ( n : f32 ) -> f32 ;
6364 pub fn erfcf ( n : f32 ) -> f32 ;
64- // pub fn lgamma_r(n: f64, s: &mut i32) -> f64;
6565 #[ cfg( not( target_os = "aix" ) ) ]
6666 pub fn lgammaf_r ( n : f32 , s : & mut i32 ) -> f32 ;
67- // pub fn tgamma(n: f64) -> f64;
6867 pub fn tgammaf ( n : f32 ) -> f32 ;
69-
70- // pub fn acosf128(n: f128) -> f128;
71- // pub fn asinf128(n: f128) -> f128;
72- // pub fn atanf128(n: f128) -> f128;
73- // pub fn atan2f128(a: f128, b: f128) -> f128;
74- // pub fn cbrtf128(n: f128) -> f128;
75- // pub fn coshf128(n: f128) -> f128;
76- // pub fn expm1f128(n: f128) -> f128;
77- // pub fn hypotf128(x: f128, y: f128) -> f128;
78- // pub fn log1pf128(n: f128) -> f128;
79- // pub fn sinhf128(n: f128) -> f128;
80- // pub fn tanf128(n: f128) -> f128;
81- // pub fn tanhf128(n: f128) -> f128;
82- // pub fn tgammaf128(n: f128) -> f128;
83- // pub fn lgammaf128_r(n: f128, s: &mut i32) -> f128;
84- // pub fn erff128(n: f128) -> f128;
85- // pub fn erfcf128(n: f128) -> f128;
86-
87- // cfg_if::cfg_if! {
88- // if #[cfg(not(all(target_os = "windows", target_env = "msvc", target_arch = "x86")))] {
89- // pub fn acosf(n: f32) -> f32;
90- // pub fn asinf(n: f32) -> f32;
91- // pub fn atan2f(a: f32, b: f32) -> f32;
92- // pub fn atanf(n: f32) -> f32;
93- // pub fn coshf(n: f32) -> f32;
94- // pub fn sinhf(n: f32) -> f32;
95- // pub fn tanf(n: f32) -> f32;
96- // pub fn tanhf(n: f32) -> f32;
97- // }}
9868}
0 commit comments