CYGWIN seems to include _mingw.h and thus __MINGW64_VERSION_MAJOR is
defined even though rand_s is not available. Thus add an extra check
for __CYGWIN__.
2017-02-27 Janne Blomqvist <jb@gcc.gnu.org>
* intrinsics/random.c (getosrandom): Don't try to use rand_s on
CYGWIN.
From-SVN: r245755
+2017-02-27 Janne Blomqvist <jb@gcc.gnu.org>
+
+ * intrinsics/random.c (getosrandom): Don't try to use rand_s on
+ CYGWIN.
+
2017-02-16 Paul Thomas <pault@gcc.gnu.org>
PR fortran/79382
getosrandom (void *buf, size_t buflen)
{
/* rand_s is available in MinGW-w64 but not plain MinGW. */
-#ifdef __MINGW64_VERSION_MAJOR
+#if defined(__MINGW64_VERSION_MAJOR) && !defined(__CYGWIN__)
unsigned int* b = buf;
for (unsigned i = 0; i < buflen / sizeof (unsigned int); i++)
rand_s (&b[i]);