Skip to content

Commit 7963440

Browse files
authored
Fix rand_jitter on older versions of rust
In at least rust 1.26 on osx, rand_jitter has a compile error due to libc not being imported. I'm guessing this was fixed as part of the 2018 edition, which is why this isn't showing up on the stable build.
1 parent a8dc9ad commit 7963440

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

rand_jitter/src/platform.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ pub fn get_nstime() -> u64 {
2121

2222
#[cfg(any(target_os = "macos", target_os = "ios"))]
2323
pub fn get_nstime() -> u64 {
24+
use libc;
25+
2426
// On Mac OS and iOS std::time::SystemTime only has 1000ns resolution.
2527
// We use `mach_absolute_time` instead. This provides a CPU dependent
2628
// unit, to get real nanoseconds the result should by multiplied by

0 commit comments

Comments
 (0)