Sfoglia il codice sorgente

Merge pull request #277 from alexcrichton/less-wasi-sysm

Don't compile math symbols on wasm32-unknown-wasi
Alex Crichton 6 anni fa
parent
commit
cc7567e471
1 ha cambiato i file con 8 aggiunte e 3 eliminazioni
  1. 8 3
      src/math.rs

+ 8 - 3
src/math.rs

@@ -14,9 +14,14 @@ macro_rules! no_mangle {
     }
 }
 
-// only for the wasm32-unknown-unknown target
-#[cfg(any(all(target_arch = "wasm32", target_os = "unknown"),
-          all(target_vendor = "fortanix", target_env = "sgx")))]
+#[cfg(any(
+    all(
+        target_arch = "wasm32",
+        target_os = "unknown",
+        not(target_env = "wasi")
+    ),
+    all(target_vendor = "fortanix", target_env = "sgx")
+))]
 no_mangle! {
     fn acos(x: f64) -> f64;
     fn asin(x: f64) -> f64;