]> www.ginac.de Git - cln.git/blobdiff - src/base/random/cl_random_from.cc
* Add support for OpenBSD.
[cln.git] / src / base / random / cl_random_from.cc
index 1b2ad609dc51e30e80b45099cd7eaea516227ba4..3e10b12a90d10bcc24f8547c8afa0f05d5f33de4 100644 (file)
@@ -68,6 +68,9 @@ random_state::random_state ()
        seed_lo = ::get_seed();
        seed_hi = (rand() // zufällige 31 Bit (bei UNIX_BSD) bzw. 16 Bit (bei UNIX_SYSV)
                           << 8) ^ (uintL)(getpid()); // ca. 8 Bit von der Process ID
+#elif defined(__OpenBSD__)
+       seed_lo = arc4random();
+       seed_hi = arc4random();
 #elif defined(__atarist)
        seed_lo = highlow32(GEMDOS_GetDate(),GEMDOS_GetTime()); // 16+16 zufällige Bits
        seed_hi = XBIOS_Random(); // 24 Bit zufällig vom XBIOS, vorne 8 Nullbits