[project @ 1999-09-13 11:01:05 by sof]
[ghc-hetmet.git] / ghc / rts / gmp / urandom.h
index 994e7bd..37221c2 100644 (file)
@@ -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 ();