about summary refs log tree commit diff
path: root/src/libtime
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-06-16 06:32:03 +0000
committerbors <bors@rust-lang.org>2014-06-16 06:32:03 +0000
commit2ef910f71ab83761b1f5f9144621f246622e92d8 (patch)
tree260c5393432cab41234c55eb88f24575afa2ad16 /src/libtime
parent6d8342f5e9f7093694548e761ee7df4f55243f3f (diff)
parent2ec323e4c30c265f35314c0a77f5df5a655cec2f (diff)
downloadrust-2ef910f71ab83761b1f5f9144621f246622e92d8.tar.gz
rust-2ef910f71ab83761b1f5f9144621f246622e92d8.zip
auto merge of #14715 : vhbit/rust/ios-pr2, r=alexcrichton
Diffstat (limited to 'src/libtime')
-rw-r--r--src/libtime/lib.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libtime/lib.rs b/src/libtime/lib.rs
index 4cade394105..79f8cd3379a 100644
--- a/src/libtime/lib.rs
+++ b/src/libtime/lib.rs
@@ -46,7 +46,7 @@ mod rustrt {
     }
 }
 
-#[cfg(unix, not(target_os = "macos"))]
+#[cfg(unix, not(target_os = "macos"), not(target_os = "ios"))]
 mod imp {
     use libc::{c_int, timespec};
 
@@ -61,6 +61,7 @@ mod imp {
 
 }
 #[cfg(target_os = "macos")]
+#[cfg(target_os = "ios")]
 mod imp {
     use libc::{timeval, timezone, c_int, mach_timebase_info};
 
@@ -121,6 +122,7 @@ pub fn get_time() -> Timespec {
     }
 
     #[cfg(target_os = "macos")]
+    #[cfg(target_os = "ios")]
     unsafe fn os_get_time() -> (i64, i32) {
         use std::ptr;
         let mut tv = libc::timeval { tv_sec: 0, tv_usec: 0 };
@@ -128,7 +130,7 @@ pub fn get_time() -> Timespec {
         (tv.tv_sec as i64, tv.tv_usec * 1000)
     }
 
-    #[cfg(not(target_os = "macos"), not(windows))]
+    #[cfg(not(target_os = "macos"), not(target_os = "ios"), not(windows))]
     unsafe fn os_get_time() -> (i64, i32) {
         let mut tv = libc::timespec { tv_sec: 0, tv_nsec: 0 };
         imp::clock_gettime(libc::CLOCK_REALTIME, &mut tv);
@@ -160,6 +162,7 @@ pub fn precise_time_ns() -> u64 {
     }
 
     #[cfg(target_os = "macos")]
+    #[cfg(target_os = "ios")]
     fn os_precise_time_ns() -> u64 {
         static mut TIMEBASE: libc::mach_timebase_info = libc::mach_timebase_info { numer: 0,
                                                                                    denom: 0 };
@@ -173,7 +176,7 @@ pub fn precise_time_ns() -> u64 {
         }
     }
 
-    #[cfg(not(windows), not(target_os = "macos"))]
+    #[cfg(not(windows), not(target_os = "macos"), not(target_os = "ios"))]
     fn os_precise_time_ns() -> u64 {
         let mut ts = libc::timespec { tv_sec: 0, tv_nsec: 0 };
         unsafe {