mirror of
https://github.com/ziglang/zig.git
synced 2024-11-16 00:57:04 +00:00
Fix compile errors for MacOS
This commit is contained in:
parent
2dfe798217
commit
b85a191398
@ -74,10 +74,9 @@ pub fn _init_timestart() void {
|
||||
var micro: os.darwin.timeval = undefined;
|
||||
var timestart: DarwinTimeStart = undefined;
|
||||
|
||||
var err = os.darwin.mach_timebase_info(×tart.timebase);
|
||||
assert(err == 0);
|
||||
os.darwin.mach_timebase_info(×tart.timebase);
|
||||
|
||||
err = os.darwin.gettimeofday(µ, null);
|
||||
const err = os.darwin.gettimeofday(µ, null);
|
||||
assert(err == 0);
|
||||
|
||||
timestart.initclock = os.darwin.mach_absolute_time();
|
||||
@ -119,7 +118,7 @@ pub fn nanoTimestamp() u64 {
|
||||
_init_timestart_once.call();
|
||||
|
||||
const clock: u64 = os.darwin.mach_absolute_time() - _timestart.initclock;
|
||||
const nano = clock * @divFloor(@as(u64, _timestart.timebase.number), @as(u64, _timestart.timebase.denom));
|
||||
const nano = @divFloor(clock * @as(u64, _timestart.timebase.numer), @as(u64, _timestart.timebase.denom));
|
||||
|
||||
const tv_sec_nsec = @intCast(u64, _timestart.inittime.tv_sec) * ns_per_s;
|
||||
const tv_nsec = @intCast(u64, _timestart.inittime.tv_nsec);
|
||||
|
Loading…
Reference in New Issue
Block a user