diff options
author | Kevin Ryde <user42@zip.com.au> | 2001-02-07 01:30:05 +0100 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2001-02-07 01:30:05 +0100 |
commit | 7b6bd24689bf66366bcc5f203ad665864dc1357e (patch) | |
tree | dbeaad91403254bbd622183cc298542457f0d7d2 /mpn/generic/random2.c | |
parent | bd98efb810ae607d5ffca383c252c2fd08986f1b (diff) | |
download | gmp-7b6bd24689bf66366bcc5f203ad665864dc1357e.tar.gz |
* mpn/generic/random2.c (myrandom): Use rand() on mingw.
Diffstat (limited to 'mpn/generic/random2.c')
-rw-r--r-- | mpn/generic/random2.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mpn/generic/random2.c b/mpn/generic/random2.c index eb9ac3d84..35af9524e 100644 --- a/mpn/generic/random2.c +++ b/mpn/generic/random2.c @@ -25,6 +25,14 @@ MA 02111-1307, USA. */ #include "gmp.h" #include "gmp-impl.h" +#ifdef __MINGW32__ +/* msvcrt.dll lacks random() */ +static inline long +myrandom () +{ + return rand(); +} +#else #if defined (__hpux) || defined (__alpha) || defined (__svr4__) || defined (__SVR4) /* HPUX lacks random(). DEC OSF/1 1.2 random() returns a double. */ static inline long @@ -39,6 +47,7 @@ myrandom () return random (); } #endif +#endif /* It's a bit tricky to get this right, so please test the code well if you hack with it. Some early versions of the function produced |