Skip to content

Commit f5caff9

Browse files
committed
fix nim-lang#17078 csources generation
1 parent 4c56873 commit f5caff9

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/pure/concurrency/cpuinfo.nim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ runnableExamples:
1515

1616
include "system/inclrtl"
1717

18-
when defined(linux):
18+
# when defined(linux) or defined(solaris):
19+
when defined(posix):
20+
# import posix {.used.}
1921
import posix
2022

2123
when defined(freebsd) or defined(macosx):

lib/std/sysrand.nim

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ when not defined(js):
5353
when defined(posix):
5454
import std/posix
5555

56-
const batchImplOS = defined(freebsd) or defined(openbsd) or (defined(macosx) and not defined(ios))
56+
const
57+
batchImplOS = defined(freebsd) or defined(openbsd) or (defined(macosx) and not defined(ios))
58+
batchSize {.used.} = 256
5759

5860
when batchImplOS:
59-
const batchSize = 256
60-
6161
template batchImpl(result: var int, dest: var openArray[byte], getRandomImpl) =
6262
let size = dest.len
6363
if size == 0:
@@ -94,8 +94,6 @@ when defined(js):
9494
dest[i] = src[i]
9595

9696
else:
97-
const batchSize = 256
98-
9997
proc getRandomValues(p: Uint8Array) {.importjs: "window.crypto.getRandomValues(#)".}
10098
# The requested length of `p` must not be more than 65536.
10199

0 commit comments

Comments
 (0)