Skip to content

Commit

Permalink
Fix: C++ codegen generates invalid cast.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleyva1 committed Jul 12, 2024
1 parent 7c28ffa commit dc8a969
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/pure/osproc.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1396,10 +1396,12 @@ elif not defined(useNimRtl):
raiseOSError(osLastError())
else:
let newWait = getTime() + delay
var waitSpec: TimeSpec
var
waitSpec: TimeSpec
unused: Timespec
waitSpec.tv_sec = posix.Time(newWait.toUnix())
waitSpec.tv_nsec = newWait.nanosecond.clong
discard posix.clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, waitSpec, cast[var TimeSpec](nil))
discard posix.clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, waitSpec, unused)
let remaining = deadline - getTime()
delay = min([delay * 2, remaining, maxWait])

Expand Down

0 comments on commit dc8a969

Please sign in to comment.