Use `intrinsics!` macro for math intrinsics
Make sure they respect the `mangled-names` feature as well as have the `"C"` ABI.
This commit is contained in:
parent
cc78ff665d
commit
d73ccba988
13
src/math.rs
13
src/math.rs
|
@ -4,12 +4,13 @@ mod libm;
|
||||||
|
|
||||||
macro_rules! no_mangle {
|
macro_rules! no_mangle {
|
||||||
($(fn $fun:ident($($iid:ident : $ity:ty),+) -> $oty:ty;)+) => {
|
($(fn $fun:ident($($iid:ident : $ity:ty),+) -> $oty:ty;)+) => {
|
||||||
$(
|
intrinsics! {
|
||||||
#[no_mangle]
|
$(
|
||||||
pub fn $fun($($iid: $ity),+) -> $oty {
|
pub extern "C" fn $fun($($iid: $ity),+) -> $oty {
|
||||||
self::libm::$fun($($iid),+)
|
self::libm::$fun($($iid),+)
|
||||||
}
|
}
|
||||||
)+
|
)+
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue