delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/04/09/18:27:10

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-Id: <199904092226.RAA15871@modi.xraylith.wisc.edu>
X-Authentication-Warning: modi.xraylith.wisc.edu: localhost.xraylith.wisc.edu [127.0.0.1] didn't use HELO protocol
To: "Phil Edwards" <devphil AT my-dejanews DOT com>
cc: "Cygwin List" <cygwin AT sourceware DOT cygnus DOT com>
Subject: Re: random_shuffle failure on B20.1?
In-reply-to: Your message of "Fri, 09 Apr 1999 13:34:29 -0800."
<EOOBPHHBKCEAAAAA AT my-dejanews DOT com>
Date: Fri, 09 Apr 1999 17:26:05 -0500
From: Mumit Khan <khan AT xraylith DOT wisc DOT EDU>

"Phil Edwards" <devphil AT my-dejanews DOT com> writes:
> 
> I've been doing some work under B20.1/egcs-1.1.2 using
> -mno-cygwin, and getting errors when I try to use the
> standard algorithm random_shuffle() (which I have
> used before, so I know the STL code isn't completely
> full of cheese, etc).

Please look up the specs for random_shuffle -- it requires a
random access iterator (hint: use deque as opposed to list).

> 
> The error messages, and an almost-minimal test case,
> were saved to bug.txt; the file is attached.
> 
> When I used random_shuffle before, I had problems
> because the 48-bit generator would be used instead of
> the older generator; we had to call srand48() instead
> of srand() before random became truly random.  But
> at least it compiled then... is {,l,r}rand() not
> implemented on the LoseNT end, or is the wrong cpp
> macro being defined?

Here's a patch for Mingw ... please patch the stl_config.h file located
in the <install_root>/include/g++ directory with the following:

--- stl_config.h.~1	Fri Apr  9 17:19:19 1999
+++ stl_config.h	Fri Apr  9 17:20:38 1999
@@ -138,6 +138,10 @@
 #   define __STL_USE_NAMESPACES
 # endif
 
+# if defined(__GNUC__) && defined(__MINGW32__)
+#   define __STL_NO_DRAND48
+# endif
+
 # if defined(_MSC_VER)
 #   if _MSC_VER > 1000
 #     include <yvals.h>

Regards,
Mumit



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019