From d73ccba9886acc132a1d7e9565509c98fdd7c39b Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 18 Jul 2018 10:04:33 -0700 Subject: [PATCH] Use `intrinsics!` macro for math intrinsics Make sure they respect the `mangled-names` feature as well as have the `"C"` ABI. --- src/math.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/math.rs b/src/math.rs index 76bb726..f1eaaa5 100644 --- a/src/math.rs +++ b/src/math.rs @@ -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),+) + } + )+ + } } }