about summary refs log tree commit diff
path: root/src/libnative/io/util.rs
diff options
context:
space:
mode:
authorPeter Atashian <retep998@gmail.com>2014-08-07 04:05:00 -0400
committerPeter Atashian <retep998@gmail.com>2014-08-07 04:05:00 -0400
commitfeb219d23fd4236fc69ec86e34c088e232289534 (patch)
tree460d17654ca883be34400eef5f1a17e0d8d54073 /src/libnative/io/util.rs
parent51e19e750185f60e404412f702f8f2edc7bc1245 (diff)
downloadrust-feb219d23fd4236fc69ec86e34c088e232289534.tar.gz
rust-feb219d23fd4236fc69ec86e34c088e232289534.zip
windows: Fix several tests on 64-bit.
Signed-off-by: Peter Atashian <retep998@gmail.com>
Diffstat (limited to 'src/libnative/io/util.rs')
-rw-r--r--src/libnative/io/util.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libnative/io/util.rs b/src/libnative/io/util.rs
index 06046cc74cf..97518bbf199 100644
--- a/src/libnative/io/util.rs
+++ b/src/libnative/io/util.rs
@@ -52,6 +52,14 @@ pub fn eof() -> IoError {
     }
 }
 
+#[cfg(windows)]
+pub fn ms_to_timeval(ms: u64) -> libc::timeval {
+    libc::timeval {
+        tv_sec: (ms / 1000) as libc::c_long,
+        tv_usec: ((ms % 1000) * 1000) as libc::c_long,
+    }
+}
+#[cfg(not(windows))]
 pub fn ms_to_timeval(ms: u64) -> libc::timeval {
     libc::timeval {
         tv_sec: (ms / 1000) as libc::time_t,