Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
finnvoor committed Apr 6, 2024
1 parent f293771 commit 1a5c91f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/PlaydateKit/Playdate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,15 @@ public enum Playdate {
}

nonisolated(unsafe) var arc4random_seed: CUnsignedInt = 0
@_documentation(visibility: internal)
@_cdecl("arc4random") public func arc4random() -> UInt32 {
arc4random_seed = 1664525 &* arc4random_seed &+ 1013904223
return arc4random_seed
}

/// Implement `arc4random_buf` which is required by the Embedded Swift runtime for Hashable, Set, Dictionary,
/// and random-number generating APIs but is not provided by the Playdate C library.
@_documentation(visibility: internal)
@_cdecl("arc4random_buf") public func arc4random_buf(buf: UnsafeMutableRawPointer, nbytes: Int) {
var r = arc4random()
for i in 0..<nbytes {
Expand Down

0 comments on commit 1a5c91f

Please sign in to comment.