5
5
macro_rules! export {
6
6
( $( fn $fn: ident( $( $arg: ident: $argty: ty) ,+) -> $retty: ty; ) +) => {
7
7
$(
8
+ #[ linkage = "weak_odr" ]
8
9
#[ unsafe ( no_mangle) ]
9
10
pub extern "C" fn $fn( $( $arg: $argty) ,+) -> $retty {
10
11
:: libm:: $fn( $( $arg) ,+)
@@ -143,6 +144,7 @@ export! {
143
144
macro_rules! export_out_param {
144
145
( $( fn $fn: ident( $( $arg: ident: $argty: ty) ,+; $out: ident: $outty: ty) -> $retty: ty; ) +) => {
145
146
$(
147
+ #[ linkage = "weak_odr" ]
146
148
#[ unsafe ( no_mangle) ]
147
149
pub extern "C" fn $fn( $( $arg: $argty) ,+, $out: $outty) -> $retty {
148
150
let ( ret, out) = :: libm:: $fn( $( $arg) ,+) ;
@@ -164,11 +166,13 @@ export_out_param! {
164
166
fn remquof( x: f32 , y: f32 ; n: & mut i32 ) -> f32 ;
165
167
}
166
168
169
+ #[ linkage = "weak_odr" ]
167
170
#[ unsafe( no_mangle) ]
168
171
pub extern "C" fn sincos ( x : f64 , s : & mut f64 , c : & mut f64 ) {
169
172
( * s, * c) = libm:: sincos ( x) ;
170
173
}
171
174
175
+ #[ linkage = "weak_odr" ]
172
176
#[ unsafe( no_mangle) ]
173
177
pub extern "C" fn sincosf ( x : f32 , s : & mut f32 , c : & mut f32 ) {
174
178
( * s, * c) = libm:: sincosf ( x) ;
@@ -181,6 +185,7 @@ pub extern "C" fn sincosf(x: f32, s: &mut f32, c: &mut f32) {
181
185
/// `arg` has to point to a valid [`CStr`].
182
186
///
183
187
/// [`CStr`]: core::ffi::CStr
188
+ #[ linkage = "weak_odr" ]
184
189
#[ unsafe( no_mangle) ]
185
190
pub unsafe extern "C" fn nan ( arg : * const core:: ffi:: c_char ) -> f64 {
186
191
let _arg = arg;
@@ -194,6 +199,7 @@ pub unsafe extern "C" fn nan(arg: *const core::ffi::c_char) -> f64 {
194
199
/// `arg` has to point to a valid [`CStr`].
195
200
///
196
201
/// [`CStr`]: core::ffi::CStr
202
+ #[ linkage = "weak_odr" ]
197
203
#[ unsafe( no_mangle) ]
198
204
pub unsafe extern "C" fn nanf ( arg : * const core:: ffi:: c_char ) -> f32 {
199
205
let _arg = arg;
0 commit comments