Commit 9449b700 by Janne Blomqvist

Don't try to use rand_s on CYGWIN

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
parent 57fa080b
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
......
......@@ -304,7 +304,7 @@ static int
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]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment