diff options
author | Richard M. Stallman <rms@gnu.org> | 1994-07-27 17:40:29 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1994-07-27 17:40:29 +0000 |
commit | 768daa5e9f5cce7fdf1140dea5b32306e3dd68dc (patch) | |
tree | 497aca51ef078c8d1dea802d6ce29da88068a952 /src/sysdep.c | |
parent | d84cf9c948bca7deb35a143be5697d9d3c2b8aa9 (diff) | |
download | emacs-768daa5e9f5cce7fdf1140dea5b32306e3dd68dc.tar.gz |
(random, srandom): Obey HAVE_RAND48 flag.
Test that random is not a macro. Don't test USG or BSD4_1.
Diffstat (limited to 'src/sysdep.c')
-rw-r--r-- | src/sysdep.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index 828ec00f619..c6a3b4f7a82 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -2597,7 +2597,8 @@ bcmp (b1, b2, length) /* This could be a macro! */ #endif /* not BSTRING */ #ifndef HAVE_RANDOM -#ifdef USG +#ifndef random + /* * The BSD random returns numbers in the range of * 0 to 2e31 - 1. The USG rand returns numbers in the @@ -2608,32 +2609,26 @@ bcmp (b1, b2, length) /* This could be a macro! */ long random () { +#ifdef HAVE_RAND48 + return rand48 (); +#else /* Arrange to return a range centered on zero. */ return (rand () << 15) + rand () - (1 << 29); +#endif } srandom (arg) int arg; { +#ifdef HAVE_RAND48 + return srand48 (); +#else srand (arg); +#endif } -#endif /* USG */ - -#ifdef BSD4_1 -long random () -{ - /* Arrange to return a range centered on zero. */ - return (rand () << 15) + rand () - (1 << 29); -} - -srandom (arg) - int arg; -{ - srand (arg); -} -#endif /* BSD4_1 */ -#endif +#endif /* no random */ +#endif /* not HAVE_RANDOM */ #ifdef WRONG_NAME_INSQUE |