File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,9 @@ runnableExamples:
15
15
16
16
include " system/inclrtl"
17
17
18
- when defined(linux):
18
+ # when defined(linux) or defined(solaris):
19
+ when defined(posix):
20
+ # import posix {.used.}
19
21
import posix
20
22
21
23
when defined(freebsd) or defined(macosx):
Original file line number Diff line number Diff line change @@ -53,11 +53,11 @@ when not defined(js):
53
53
when defined(posix):
54
54
import std/ posix
55
55
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
57
59
58
60
when batchImplOS:
59
- const batchSize = 256
60
-
61
61
template batchImpl(result : var int , dest: var openArray [byte ], getRandomImpl) =
62
62
let size = dest.len
63
63
if size == 0 :
@@ -94,8 +94,6 @@ when defined(js):
94
94
dest[i] = src[i]
95
95
96
96
else :
97
- const batchSize = 256
98
-
99
97
proc getRandomValues(p: Uint8Array) {.importjs: " window.crypto.getRandomValues(#)" .}
100
98
# The requested length of `p` must not be more than 65536.
101
99
You can’t perform that action at this time.
0 commit comments