From 7a8abb20ab5f214d8fb5713420a5dc5fd61ef79c Mon Sep 17 00:00:00 2001 From: Ignacio Casal Quinteiro Date: Wed, 24 Feb 2016 11:27:09 +0100 Subject: grand: rand_s is available in mingw64 --- glib/grand.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/glib/grand.c b/glib/grand.c index ac1053daf..0cb833e9a 100644 --- a/glib/grand.c +++ b/glib/grand.c @@ -262,8 +262,10 @@ g_rand_new (void) seed[3] = getppid (); } #else /* G_OS_WIN32 */ - /* rand_s() is only available since Visual Studio 2005 */ -#if defined(_MSC_VER) && _MSC_VER >= 1400 + /* rand_s() is only available since Visual Studio 2005 and + * 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; for (i = 0; i < G_N_ELEMENTS (seed); i++) -- cgit v1.2.1