Merge bleeding_edge r5900 to trunk. Remove rand_s seeding on Windows
because it makes browser tests fail.
TBR=sgjesse@chromium.org
Review URL: http://codereview.chromium.org/5276010
git-svn-id: http://v8.googlecode.com/svn/trunk@5901 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/platform-win32.cc b/src/platform-win32.cc
index 1dcc84b..c50424e 100644
--- a/src/platform-win32.cc
+++ b/src/platform-win32.cc
@@ -54,11 +54,6 @@
#define _WIN32_WINNT 0x501
#endif
-// Required before stdlib.h inclusion for cryptographically strong rand_s.
-#ifndef _CRT_RAND_S
-#define _CRT_RAND_S
-#endif // _CRT_RAND_S
-
#include <windows.h>
#include <time.h> // For LocalOffset() implementation.
@@ -589,8 +584,11 @@
void OS::Setup() {
// Seed the random number generator.
- unsigned int seed;
- CHECK_EQ(rand_s(&seed), 0);
+ // Convert the current time to a 64-bit integer first, before converting it
+ // to an unsigned. Going directly can cause an overflow and the seed to be
+ // set to all ones. The seed will be identical for different instances that
+ // call this setup code within the same millisecond.
+ uint64_t seed = static_cast<uint64_t>(TimeCurrentMillis());
srand(static_cast<unsigned int>(seed));
}
diff --git a/src/version.cc b/src/version.cc
index 61d314a..6e5b68f 100644
--- a/src/version.cc
+++ b/src/version.cc
@@ -35,7 +35,7 @@
#define MAJOR_VERSION 2
#define MINOR_VERSION 5
#define BUILD_NUMBER 9
-#define PATCH_LEVEL 0
+#define PATCH_LEVEL 1
#define CANDIDATE_VERSION false
// Define SONAME to have the SCons build the put a specific SONAME into the