Explorar el Código

Use `intrinsics!` macro for math intrinsics

Make sure they respect the `mangled-names` feature as well as have the `"C"`
ABI.
Alex Crichton hace 6 años
padre
commit
d73ccba988
Se han modificado 1 ficheros con 7 adiciones y 6 borrados
  1. 7 6
      src/math.rs

+ 7 - 6
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),+)
+                }
+            )+
+        }
     }
 }