about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-01-16 20:53:26 +0530
committerGitHub <noreply@github.com>2020-01-16 20:53:26 +0530
commitc8125fb36a7d0f06e21ca891d993c85b9fd884b6 (patch)
tree028ce1aca0f825ddf30b2bea25e2557500253b43 /src/libstd/sys
parent9fe05e9456b84996637c2f29b35c37960e537540 (diff)
parent084217af65b212c3c68f66d798faa19bcef5007a (diff)
downloadrust-c8125fb36a7d0f06e21ca891d993c85b9fd884b6.tar.gz
rust-c8125fb36a7d0f06e21ca891d993c85b9fd884b6.zip
Rollup merge of #68033 - ollie27:win_f32, r=dtolnay
Don't use f64 shims for f32 cmath functions on non 32-bit x86 MSVC

These shims are only needed on 32-bit x86. Additionally since https://reviews.llvm.org/rL268875 LLVM handles adding the shims itself for the intrinsics.
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/windows/cmath.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libstd/sys/windows/cmath.rs b/src/libstd/sys/windows/cmath.rs
index 6f5d40b494f..1a5421facd0 100644
--- a/src/libstd/sys/windows/cmath.rs
+++ b/src/libstd/sys/windows/cmath.rs
@@ -27,7 +27,7 @@ extern "C" {
 
 pub use self::shims::*;
 
-#[cfg(not(target_env = "msvc"))]
+#[cfg(not(all(target_env = "msvc", target_arch = "x86")))]
 mod shims {
     use libc::c_float;
 
@@ -43,10 +43,10 @@ mod shims {
     }
 }
 
-// On MSVC these functions aren't defined, so we just define shims which promote
-// everything fo f64, perform the calculation, and then demote back to f32.
-// While not precisely correct should be "correct enough" for now.
-#[cfg(target_env = "msvc")]
+// On 32-bit x86 MSVC these functions aren't defined, so we just define shims
+// which promote everything fo f64, perform the calculation, and then demote
+// back to f32. While not precisely correct should be "correct enough" for now.
+#[cfg(all(target_env = "msvc", target_arch = "x86"))]
 mod shims {
     use libc::c_float;