changeset 8358:f9d8f778f73b

(random, srandom): Obey HAVE_RAND48 flag. Test that random is not a macro. Don't test USG or BSD4_1.
author Richard M. Stallman <rms@gnu.org>
date Wed, 27 Jul 1994 17:40:29 +0000
parents 0f6512963c6d
children a9f95d2ac181
files src/sysdep.c
diffstat 1 files changed, 12 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/src/sysdep.c	Wed Jul 27 17:34:52 1994 +0000
+++ b/src/sysdep.c	Wed Jul 27 17:40:29 1994 +0000
@@ -2597,7 +2597,8 @@
 #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 @@
 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