Skip to content

Commit

Permalink
fix #17078 csources generation (#17079)
Browse files Browse the repository at this point in the history
* fix #17078 csources generation

* fixup
  • Loading branch information
timotheecour authored Feb 18, 2021
1 parent 8873ec6 commit f455e03
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/pure/concurrency/cpuinfo.nim
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ runnableExamples:

include "system/inclrtl"

when defined(linux):
when defined(posix) and not (defined(macosx) or defined(bsd)):
import posix

when defined(freebsd) or defined(macosx):
Expand Down
8 changes: 3 additions & 5 deletions lib/std/sysrand.nim
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ when not defined(js):
when defined(posix):
import std/posix

const batchImplOS = defined(freebsd) or defined(openbsd) or (defined(macosx) and not defined(ios))
const
batchImplOS = defined(freebsd) or defined(openbsd) or (defined(macosx) and not defined(ios))
batchSize {.used.} = 256

when batchImplOS:
const batchSize = 256

template batchImpl(result: var int, dest: var openArray[byte], getRandomImpl) =
let size = dest.len
if size == 0:
Expand Down Expand Up @@ -94,8 +94,6 @@ when defined(js):
dest[i] = src[i]

else:
const batchSize = 256

proc getRandomValues(p: Uint8Array) {.importjs: "window.crypto.getRandomValues(#)".}
# The requested length of `p` must not be more than 65536.

Expand Down

0 comments on commit f455e03

Please sign in to comment.