summaryrefslogtreecommitdiffstats
path: root/gnu/lib/libgmp/tests/urandom.h
blob: e01858099542a152f94d2773582cac9d7b1005db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#if defined (hpux) || defined (__alpha__)
/* HPUX lacks random().  DEC Alpha's random() returns a double.  */
static inline unsigned long
urandom ()
{
  return mrand48 ();
}
#else
long random ();

static inline unsigned long
urandom ()
{
  /* random() returns 31 bits, we want 32.  */
  return random() ^ (random() << 1);
}
#endif
OpenPOWER on IntegriCloud