Skip to content

Commit 06dc63c

Browse files
authored
Fix WASI platform build issue (#291)
1 parent 62958ed commit 06dc63c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/CryptoBoringWrapper/Util/RandomBytes.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ extension UnsafeMutableRawBufferPointer {
2121

2222
#if canImport(Darwin) || os(Linux) || os(Android) || os(Windows)
2323
var rng = SystemRandomNumberGenerator()
24-
#else
25-
fatalError("No secure random number generator on this platform.")
26-
#endif
2724
precondition(count <= self.count)
2825

2926
// We store bytes 64-bits at a time until we can't anymore.
@@ -41,6 +38,9 @@ extension UnsafeMutableRawBufferPointer {
4138
remainingWord >>= 8
4239
targetPtr = UnsafeMutableRawBufferPointer(rebasing: targetPtr[1...])
4340
}
41+
#else
42+
fatalError("No secure random number generator on this platform.")
43+
#endif
4444
}
4545
}
4646

0 commit comments

Comments
 (0)