diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-11-02 16:23:22 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-11-09 22:55:50 -0800 |
| commit | 3d28b8b98e6e4f55ef4ecd8babf0a050f48a3d11 (patch) | |
| tree | 343087c9e62da65e2780db851682280697064c5b /src/libstd/sys/windows/time.rs | |
| parent | c8a29c2092cec369a751051a2bfed093522ff6e8 (diff) | |
| download | rust-3d28b8b98e6e4f55ef4ecd8babf0a050f48a3d11.tar.gz rust-3d28b8b98e6e4f55ef4ecd8babf0a050f48a3d11.zip | |
std: Migrate to the new libc
* Delete `sys::unix::{c, sync}` as these are now all folded into libc itself
* Update all references to use `libc` as a result.
* Update all references to the new flat namespace.
* Moves all windows bindings into sys::c
Diffstat (limited to 'src/libstd/sys/windows/time.rs')
| -rw-r--r-- | src/libstd/sys/windows/time.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/libstd/sys/windows/time.rs b/src/libstd/sys/windows/time.rs index f5a70ccc907..4dc7997d22e 100644 --- a/src/libstd/sys/windows/time.rs +++ b/src/libstd/sys/windows/time.rs @@ -7,32 +7,33 @@ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. -use libc; + use ops::Sub; -use time::Duration; use sync::Once; +use sys::c; +use time::Duration; const NANOS_PER_SEC: u64 = 1_000_000_000; pub struct SteadyTime { - t: libc::LARGE_INTEGER, + t: c::LARGE_INTEGER, } impl SteadyTime { pub fn now() -> SteadyTime { let mut t = SteadyTime { t: 0 }; - unsafe { libc::QueryPerformanceCounter(&mut t.t); } + unsafe { c::QueryPerformanceCounter(&mut t.t); } t } } -fn frequency() -> libc::LARGE_INTEGER { - static mut FREQUENCY: libc::LARGE_INTEGER = 0; +fn frequency() -> c::LARGE_INTEGER { + static mut FREQUENCY: c::LARGE_INTEGER = 0; static ONCE: Once = Once::new(); unsafe { ONCE.call_once(|| { - libc::QueryPerformanceFrequency(&mut FREQUENCY); + c::QueryPerformanceFrequency(&mut FREQUENCY); }); FREQUENCY } |
