Fixed a typo that impacts windows builds

This commit is contained in:
Benoit Steiner 2016-10-05 08:51:31 -07:00
parent ceee1c008b
commit ed7a220b04

View File

@ -26,13 +26,13 @@ EIGEN_DEVICE_FUNC uint64_t get_random_seed() {
#elif defined _WIN32 #elif defined _WIN32
// Use the current time as a baseline. // Use the current time as a baseline.
SYSTEMTIME st;
GetSystemTime(&st); GetSystemTime(&st);
int time = st.wSecond + 1000 * st.wMilliseconds; int time = st.wSecond + 1000 * st.wMilliseconds;
// Mix in a random number to make sure that we get different seeds if // Mix in a random number to make sure that we get different seeds if
// we try to generate seeds faster than the clock resolution. // we try to generate seeds faster than the clock resolution.
// We need 2 random values since the generator only generate 16 bits at // We need 2 random values since the generator only generate 16 bits at
// a time (https://msdn.microsoft.com/en-us/library/398ax69y.aspx) // a time (https://msdn.microsoft.com/en-us/library/398ax69y.aspx)
SYSTEMTIME st;
uint rnd1 = ::rand(); uint rnd1 = ::rand();
uint rnd2 = ::rand(); uint rnd2 = ::rand();
uint64_t rnd = (rnd1 | rnd2 << 16) ^ time; uint64_t rnd = (rnd1 | rnd2 << 16) ^ time;