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
f43deaa6a4
commit
bb88e27e3c
1 changed files with 7 additions and 6 deletions
|
|
@ -4,12 +4,13 @@ mod libm;
|
|||
|
||||
macro_rules! no_mangle {
|
||||
($(fn $fun:ident($($iid:ident : $ity:ty),+) -> $oty:ty;)+) => {
|
||||
$(
|
||||
#[no_mangle]
|
||||
pub fn $fun($($iid: $ity),+) -> $oty {
|
||||
self::libm::$fun($($iid),+)
|
||||
}
|
||||
)+
|
||||
intrinsics! {
|
||||
$(
|
||||
pub extern "C" fn $fun($($iid: $ity),+) -> $oty {
|
||||
self::libm::$fun($($iid),+)
|
||||
}
|
||||
)+
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue