Use QueryPerformanceFrequency as clock on windows

This commit is contained in:
Max Brunsfeld 2019-03-14 12:39:04 -07:00
parent e30e827c5f
commit 88e3907cc0
7 changed files with 76 additions and 37 deletions

View file

@ -1,6 +1,5 @@
/* automatically generated by rust-bindgen */
pub type __darwin_size_t = ::std::os::raw::c_ulong;
pub type FILE = [u64; 19usize];
pub type TSSymbol = u16;
#[repr(C)]
@ -143,10 +142,10 @@ extern "C" {
pub fn ts_parser_set_enabled(arg1: *mut TSParser, arg2: bool);
}
extern "C" {
pub fn ts_parser_timeout_micros(arg1: *const TSParser) -> usize;
pub fn ts_parser_timeout_micros(arg1: *const TSParser) -> u64;
}
extern "C" {
pub fn ts_parser_set_timeout_micros(arg1: *mut TSParser, arg2: usize);
pub fn ts_parser_set_timeout_micros(arg1: *mut TSParser, arg2: u64);
}
extern "C" {
pub fn ts_parser_reset(arg1: *mut TSParser);

View file

@ -323,11 +323,11 @@ impl Parser {
unsafe { ffi::ts_parser_reset(self.0) }
}
pub fn timeout_micros(&self) -> usize {
pub fn timeout_micros(&self) -> u64 {
unsafe { ffi::ts_parser_timeout_micros(self.0) }
}
pub fn set_timeout_micros(&mut self, timeout_micros: usize) {
pub fn set_timeout_micros(&mut self, timeout_micros: u64) {
unsafe { ffi::ts_parser_set_timeout_micros(self.0, timeout_micros) }
}