Thread: Windows tweaks
View Single Post
  #2  
Old 09-28-2010, 08:41 PM
Shadows91
Fire Beetle
 
Join Date: Jun 2009
Location: ..nosey!
Posts: 7
Default Another fix

The hash function is ambiguous on windows. use ::hash instead.


Index: MiscFunctions.cpp
================================================== =================
--- MiscFunctions.cpp (revision 1673)
+++ MiscFunctions.cpp (working copy)
@@ -396,7 +396,7 @@
//return (rand()%(high-low+1) + (low));
if(!WELLRNG_init) {
WELLRNG_init = true;
- oneseed( hash( time(NULL), clock() ) );
+ oneseed( ::hash( time(NULL), clock() ) );
WELLRNG19937 = case_1;
}
unsigned int randomnum = ((WELLRNG19937)());
@@ -414,7 +414,7 @@
//return (rand() / (double)RAND_MAX * (high - low) + low);
if(!WELLRNG_init) {
WELLRNG_init = true;
- oneseed( hash( time(NULL), clock() ) );
+ oneseed( ::hash( time(NULL), clock() ) );
WELLRNG19937 = case_1;
}
return ((WELLRNG19937)() / (double)0xffffffffUL * (high - low) + low);
Reply With Quote