Multiplatform.swift 452 B

12345678910111213141516171819202122
  1. //
  2. // Multiplatform.swift
  3. // CryptoSwift
  4. //
  5. // Created by Marcin Krzyzanowski on 03/12/15.
  6. // Copyright © 2015 Marcin Krzyzanowski. All rights reserved.
  7. //
  8. #if os(Linux)
  9. import Glibc
  10. import SwiftShims
  11. #else
  12. import Darwin
  13. #endif
  14. func cs_arc4random_uniform(upperBound: UInt32) -> UInt32 {
  15. #if os(Linux)
  16. return _swift_stdlib_arc4random_uniform(upperBound)
  17. #else
  18. return arc4random_uniform(upperBound)
  19. #endif
  20. }