From 1ccd1080e52a0c5eeec0b82d6628e678a68ddd34 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 20 May 2006 15:32:03 +0000 Subject: [PATCH] FreeBSD, NetBSD are normal Unices. --- ChangeLog | 5 +++++ src/base/random/cl_random_from.cc | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e9080bd..d732ef1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-05-20 Bruno Haible + + * src/base/random/cl_random_from.cc: Treat FreeBSD, NetBSD like other + Unix platforms. + 2006-05-07 Richard B. Kreckel * include/cln/modules.h (CL_JUMP_TO): Fix for Intel Mac. diff --git a/src/base/random/cl_random_from.cc b/src/base/random/cl_random_from.cc index 3e10b12..6c3b123 100644 --- a/src/base/random/cl_random_from.cc +++ b/src/base/random/cl_random_from.cc @@ -12,7 +12,7 @@ #include "cl_base_config.h" #include "cl_low.h" -#if defined(unix) || defined(__unix) || defined(_AIX) || defined(sinix) || (defined(__MACH__) && defined(__APPLE__)) || (defined(_WIN32) && defined(__GNUC__)) || defined(__BEOS__) +#if defined(unix) || defined(__unix) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(_AIX) || defined(sinix) || (defined(__MACH__) && defined(__APPLE__)) || (defined(_WIN32) && defined(__GNUC__)) || defined(__BEOS__) #include #include // declares getpid() @@ -64,7 +64,7 @@ random_state::random_state () { var uint32 seed_hi; var uint32 seed_lo; -#if defined(unix) || defined(__unix) || defined(_AIX) || defined(sinix) || (defined(__MACH__) && defined(__APPLE__)) || (defined(_WIN32) && defined(__GNUC__)) || defined(__BEOS__) +#if defined(unix) || defined(__unix) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(_AIX) || defined(sinix) || (defined(__MACH__) && defined(__APPLE__)) || (defined(_WIN32) && defined(__GNUC__)) || defined(__BEOS__) 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