Commit ba25dd97 authored by sof's avatar sof
Browse files

[project @ 1999-09-13 11:01:05 by sof]

GMP only depends on libiberty for the implementation of random().
Avoid this dep. on a (pure) Win32 platform.
parent 97f6e349
......@@ -31,6 +31,14 @@ random ()
{
return mrand48 ();
}
#elif defined(_WIN32) && !(defined(__CYGWIN__) || defined(__CYGWIN32__))
/* MS CRT supplies just the poxy rand(), with an upper bound of 0x7fff */
static inline unsigned long
random ()
{
return rand () ^ (rand () << 16) ^ (rand() << 32);
}
#else
long random ();
#endif
......
......@@ -29,6 +29,16 @@ urandom ()
#define __URANDOM
#endif
#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__CYGWIN32__))
/* MS CRT supplies just the poxy rand(), with an upper bound of 0x7fff */
static inline unsigned long
urandom ()
{
return rand () ^ (rand () << 16) ^ (rand() << 32);
}
#define __URANDOM
#endif
#if defined (__alpha) && !defined (__URANDOM)
/* DEC OSF/1 1.2 random() returns a double. */
long mrand48 ();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment