From 85b3479f96c2fc4c7dbeeba0bfd36e64ddc3e54c Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Tue, 15 Oct 2024 13:37:59 +0900 Subject: [PATCH] Fix EmbeddedApp example --- .../EmbeddedApp/_thingsThatShouldNotBeNeeded.swift | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Examples/Embedded/Sources/EmbeddedApp/_thingsThatShouldNotBeNeeded.swift b/Examples/Embedded/Sources/EmbeddedApp/_thingsThatShouldNotBeNeeded.swift index 773f928d..8f45ccee 100644 --- a/Examples/Embedded/Sources/EmbeddedApp/_thingsThatShouldNotBeNeeded.swift +++ b/Examples/Embedded/Sources/EmbeddedApp/_thingsThatShouldNotBeNeeded.swift @@ -17,9 +17,20 @@ func strlen(_ s: UnsafePointer) -> Int { return p - s } +enum LCG { + static var x: UInt8 = 0 + static let a: UInt8 = 0x05 + static let c: UInt8 = 0x0b + + static func next() -> UInt8 { + x = a &* x &+ c + return x + } +} + @_cdecl("arc4random_buf") public func arc4random_buf(_ buffer: UnsafeMutableRawPointer, _ size: Int) { for i in 0..