@@ -7,6 +7,7 @@ macro_rules! no_mangle {
7
7
( $( fn $fun: ident( $( $iid: ident : $ity: ty) ,+) -> $oty: ty; ) +) => {
8
8
intrinsics! {
9
9
$(
10
+ #[ cfg_attr( all( not( windows) , not( target_vendor="apple" ) ) , weak) ]
10
11
pub extern "C" fn $fun( $( $iid: $ity) ,+) -> $oty {
11
12
self :: libm:: $fun( $( $iid) ,+)
12
13
}
@@ -15,17 +16,6 @@ macro_rules! no_mangle {
15
16
}
16
17
}
17
18
18
- #[ cfg( any(
19
- all(
20
- target_family = "wasm" ,
21
- target_os = "unknown" ,
22
- not( target_env = "wasi" )
23
- ) ,
24
- target_os = "xous" ,
25
- target_os = "uefi" ,
26
- all( target_arch = "xtensa" , target_os = "none" ) ,
27
- all( target_vendor = "fortanix" , target_env = "sgx" )
28
- ) ) ]
29
19
no_mangle ! {
30
20
fn acos( x: f64 ) -> f64 ;
31
21
fn asin( x: f64 ) -> f64 ;
@@ -85,65 +75,38 @@ no_mangle! {
85
75
fn cbrtf( n: f32 ) -> f32 ;
86
76
fn hypotf( x: f32 , y: f32 ) -> f32 ;
87
77
fn tanf( n: f32 ) -> f32 ;
78
+ fn sqrtf( x: f32 ) -> f32 ;
79
+ fn sqrt( x: f64 ) -> f64 ;
80
+ fn ceil( x: f64 ) -> f64 ;
81
+ fn ceilf( x: f32 ) -> f32 ;
82
+ fn floor( x: f64 ) -> f64 ;
83
+ fn floorf( x: f32 ) -> f32 ;
84
+ fn trunc( x: f64 ) -> f64 ;
85
+ fn truncf( x: f32 ) -> f32 ;
88
86
}
89
87
90
- #[ cfg( any(
91
- all(
92
- target_family = "wasm" ,
93
- target_os = "unknown" ,
94
- not( target_env = "wasi" )
95
- ) ,
96
- target_os = "xous" ,
97
- target_os = "uefi" ,
98
- all( target_arch = "xtensa" , target_os = "none" ) ,
99
- all( target_vendor = "fortanix" , target_env = "sgx" ) ,
100
- target_os = "windows"
101
- ) ) ]
102
88
intrinsics ! {
89
+ #[ cfg_attr( all( not( windows) , not( target_vendor="apple" ) ) , weak) ]
103
90
pub extern "C" fn lgamma_r( x: f64 , s: & mut i32 ) -> f64 {
104
91
let r = self :: libm:: lgamma_r( x) ;
105
92
* s = r. 1 ;
106
93
r. 0
107
94
}
108
95
96
+ #[ cfg_attr( all( not( windows) , not( target_vendor="apple" ) ) , weak) ]
109
97
pub extern "C" fn lgammaf_r( x: f32 , s: & mut i32 ) -> f32 {
110
98
let r = self :: libm:: lgammaf_r( x) ;
111
99
* s = r. 1 ;
112
100
r. 0
113
101
}
114
102
}
115
103
116
- #[ cfg( any(
117
- target_os = "xous" ,
118
- target_os = "uefi" ,
119
- all( target_arch = "xtensa" , target_os = "none" ) ,
120
- ) ) ]
121
- no_mangle ! {
122
- fn sqrtf( x: f32 ) -> f32 ;
123
- fn sqrt( x: f64 ) -> f64 ;
124
- }
125
-
126
- #[ cfg( any(
127
- all( target_vendor = "fortanix" , target_env = "sgx" ) ,
128
- all( target_arch = "xtensa" , target_os = "none" ) ,
129
- target_os = "xous" ,
130
- target_os = "uefi"
131
- ) ) ]
132
- no_mangle ! {
133
- fn ceil( x: f64 ) -> f64 ;
134
- fn ceilf( x: f32 ) -> f32 ;
135
- fn floor( x: f64 ) -> f64 ;
136
- fn floorf( x: f32 ) -> f32 ;
137
- fn trunc( x: f64 ) -> f64 ;
138
- fn truncf( x: f32 ) -> f32 ;
139
- }
140
-
141
104
// only for the thumb*-none-eabi*, riscv32*-none-elf, x86_64-unknown-none and mips*-unknown-none targets that lack the floating point instruction set
142
105
#[ cfg( any(
143
- all ( target_arch = "arm" , target_os = "none" ) ,
144
- all( target_arch = "riscv32" , not( target_feature = "f" ) , target_os = "none" ) ,
145
- all ( target_arch = "x86_64" , target_os = "none" ) ,
146
- all ( target_arch = "mips" , target_os = "none" ) ,
106
+ target_arch = "arm" ,
107
+ all( target_arch = "riscv32" , not( target_feature = "f" ) ) ,
108
+ target_arch = "x86_64" ,
109
+ target_arch = "mips" ,
147
110
) ) ]
148
111
no_mangle ! {
149
112
fn fmin( x: f64 , y: f64 ) -> f64 ;
0 commit comments