about summary refs log tree commit diff
path: root/src/libstd/rt
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-06-30 21:55:00 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-07-02 10:44:40 -0700
commit83ee47b054deb5939be20d7d6ce03ad33d005424 (patch)
treed58439b31dd3ac21d5148f959ce5919b3b6afb80 /src/libstd/rt
parent18c39e126a833f66f58fe6cbf7b97ca4262f1c90 (diff)
downloadrust-83ee47b054deb5939be20d7d6ce03ad33d005424.tar.gz
rust-83ee47b054deb5939be20d7d6ce03ad33d005424.zip
windows: Don't link rust_builtin
This library has no shims which are actually needed on Windows now, so translate
that last easy one into Rust and then don't link it at all on Windows.
Diffstat (limited to 'src/libstd/rt')
-rw-r--r--src/libstd/rt/util.rs15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/libstd/rt/util.rs b/src/libstd/rt/util.rs
index 04f36d99c8e..031fda089c8 100644
--- a/src/libstd/rt/util.rs
+++ b/src/libstd/rt/util.rs
@@ -13,7 +13,6 @@ use io::prelude::*;
 use env;
 use fmt;
 use intrinsics;
-use libc::uintptr_t;
 use sync::atomic::{self, Ordering};
 use sys::stdio::Stderr;
 
@@ -22,10 +21,18 @@ use sys::stdio::Stderr;
 /// can't run correctly un-altered. Valgrind is there to help
 /// you notice weirdness in normal, un-doctored code paths!
 pub fn running_on_valgrind() -> bool {
-    extern {
-        fn rust_running_on_valgrind() -> uintptr_t;
+    return on_valgrind();
+    #[cfg(windows)]
+    fn on_valgrind() -> bool { false }
+
+    #[cfg(unix)]
+    fn on_valgrind() -> bool {
+        use libc::uintptr_t;
+        extern {
+            fn rust_running_on_valgrind() -> uintptr_t;
+        }
+        unsafe { rust_running_on_valgrind() != 0 }
     }
-    unsafe { rust_running_on_valgrind() != 0 }
 }
 
 /// Valgrind has a fixed-sized array (size around 2000) of segment descriptors