Skip to content

Commit 27a5529

Browse files
committed
---
yaml --- r: 155565 b: refs/heads/try2 c: 448c8bf h: refs/heads/master i: 155563: fa673ae v: v3
1 parent 221acee commit 27a5529

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: ad833526186c9dffc6a7381a3fa02c35543461c9
8+
refs/heads/try2: 448c8bf24e81d66083e26e81bbe4b2758f930436
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libtime/lib.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ mod rustrt {
4747
}
4848
}
4949

50-
#[cfg(unix, not(target_os = "macos"), not(target_os = "ios"))]
50+
#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios")))]
5151
mod imp {
5252
use libc::{c_int, timespec};
5353

@@ -61,8 +61,7 @@ mod imp {
6161
}
6262

6363
}
64-
#[cfg(target_os = "macos")]
65-
#[cfg(target_os = "ios")]
64+
#[cfg(any(target_os = "macos", target_os = "ios"))]
6665
mod imp {
6766
use libc::{timeval, timezone, c_int, mach_timebase_info};
6867

@@ -150,16 +149,15 @@ pub fn get_time() -> Timespec {
150149
((ns_since_1970 % 1000000) * 1000) as i32)
151150
}
152151

153-
#[cfg(target_os = "macos")]
154-
#[cfg(target_os = "ios")]
152+
#[cfg(any(target_os = "macos", target_os = "ios"))]
155153
unsafe fn os_get_time() -> (i64, i32) {
156154
use std::ptr;
157155
let mut tv = libc::timeval { tv_sec: 0, tv_usec: 0 };
158156
imp::gettimeofday(&mut tv, ptr::null_mut());
159157
(tv.tv_sec as i64, tv.tv_usec * 1000)
160158
}
161159

162-
#[cfg(not(target_os = "macos"), not(target_os = "ios"), not(windows))]
160+
#[cfg(not(any(target_os = "macos", target_os = "ios", windows)))]
163161
unsafe fn os_get_time() -> (i64, i32) {
164162
let mut tv = libc::timespec { tv_sec: 0, tv_nsec: 0 };
165163
imp::clock_gettime(libc::CLOCK_REALTIME, &mut tv);
@@ -190,8 +188,7 @@ pub fn precise_time_ns() -> u64 {
190188
return (ticks as u64 * 1000000000) / (ticks_per_s as u64);
191189
}
192190

193-
#[cfg(target_os = "macos")]
194-
#[cfg(target_os = "ios")]
191+
#[cfg(any(target_os = "macos", target_os = "ios"))]
195192
fn os_precise_time_ns() -> u64 {
196193
static mut TIMEBASE: libc::mach_timebase_info = libc::mach_timebase_info { numer: 0,
197194
denom: 0 };
@@ -205,7 +202,7 @@ pub fn precise_time_ns() -> u64 {
205202
}
206203
}
207204

208-
#[cfg(not(windows), not(target_os = "macos"), not(target_os = "ios"))]
205+
#[cfg(not(any(windows, target_os = "macos", target_os = "ios")))]
209206
fn os_precise_time_ns() -> u64 {
210207
let mut ts = libc::timespec { tv_sec: 0, tv_nsec: 0 };
211208
unsafe {

0 commit comments

Comments
 (0)