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__.
Thanks to Tim Prince and Nightstrike for bringing this issue to my attention. Committed as r245755. 2017-02-27 Janne Blomqvist <j...@gcc.gnu.org> * intrinsics/random.c (getosrandom): Don't try to use rand_s on CYGWIN. -- Janne Blomqvist