grand: rand_s is available in mingw64

This commit is contained in:
Ignacio Casal Quinteiro 2016-02-24 11:27:09 +01:00
parent 5e00915354
commit 7a8abb20ab

View File

@ -262,8 +262,10 @@ g_rand_new (void)
seed[3] = getppid (); seed[3] = getppid ();
} }
#else /* G_OS_WIN32 */ #else /* G_OS_WIN32 */
/* rand_s() is only available since Visual Studio 2005 */ /* rand_s() is only available since Visual Studio 2005 and
#if defined(_MSC_VER) && _MSC_VER >= 1400 * MinGW-w64 has a wrapper that will emulate rand_s() if it's not in msvcrt
*/
#if (defined(_MSC_VER) && _MSC_VER >= 1400) || defined(__MINGW64_VERSION_MAJOR)
gint i; gint i;
for (i = 0; i < G_N_ELEMENTS (seed); i++) for (i = 0; i < G_N_ELEMENTS (seed); i++)