Skip to content

Commit 1b51333

Browse files
committed
Fix macOS compilation error (v1.66)
1 parent 268bbd8 commit 1b51333

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

vm/src/stdlib/os.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1523,7 +1523,8 @@ pub(super) mod _os {
15231523
let tick_for_second = unsafe { libc::sysconf(libc::_SC_CLK_TCK) } as f64;
15241524
let c = unsafe { libc::times(&mut t as *mut _) };
15251525

1526-
if c == -1 {
1526+
// XXX: The signedness of `clock_t` varies from platform to platform.
1527+
if c == (-1i8) as libc::clock_t {
15271528
return Err(vm.new_os_error("Fail to get times".to_string()));
15281529
}
15291530

0 commit comments

Comments
 (0)