time: C.timeval struct member definitions fix

pull/2815/head
kevin70g 2019-11-19 23:28:29 +08:00 committed by Alexander Medvednikov
parent 787f49b7a0
commit 5536eb581c
1 changed files with 4 additions and 4 deletions

View File

@ -420,9 +420,9 @@ pub fn (t Time) weekday_str() string {
return days_string[i * 3..(i + 1) * 3] return days_string[i * 3..(i + 1) * 3]
} }
struct C.timeval { pub struct C.timeval {
tv_sec int tv_sec u64
tv_usec int tv_usec u64
} }
// in ms // in ms
@ -433,7 +433,7 @@ pub fn ticks() i64 {
$else { $else {
ts := C.timeval{} ts := C.timeval{}
C.gettimeofday(&ts,0) C.gettimeofday(&ts,0)
return ts.tv_sec * 1000 + (ts.tv_usec / 1000) return i64(ts.tv_sec * u64(1000) + (ts.tv_usec / u64(1000)))
} }
/* /*