Browse Source

FreeBSD, NetBSD are normal Unices.

master
Bruno Haible 19 years ago
parent
commit
1ccd1080e5
  1. 5
      ChangeLog
  2. 4
      src/base/random/cl_random_from.cc

5
ChangeLog

@ -1,3 +1,8 @@
2006-05-20 Bruno Haible <bruno@clisp.org>
* src/base/random/cl_random_from.cc: Treat FreeBSD, NetBSD like other
Unix platforms.
2006-05-07 Richard B. Kreckel <kreckel@ginac.de> 2006-05-07 Richard B. Kreckel <kreckel@ginac.de>
* include/cln/modules.h (CL_JUMP_TO): Fix for Intel Mac. * include/cln/modules.h (CL_JUMP_TO): Fix for Intel Mac.

4
src/base/random/cl_random_from.cc

@ -12,7 +12,7 @@
#include "cl_base_config.h" #include "cl_base_config.h"
#include "cl_low.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 <sys/types.h> #include <sys/types.h>
#include <unistd.h> // declares getpid() #include <unistd.h> // declares getpid()
@ -64,7 +64,7 @@ random_state::random_state ()
{ {
var uint32 seed_hi; var uint32 seed_hi;
var uint32 seed_lo; 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_lo = ::get_seed();
seed_hi = (rand() // zufällige 31 Bit (bei UNIX_BSD) bzw. 16 Bit (bei UNIX_SYSV) 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 << 8) ^ (uintL)(getpid()); // ca. 8 Bit von der Process ID

Loading…
Cancel
Save