2015-02-19 Jon TURNEY * include/cygwin/stdlib.h (initstate, random, setstate, srandom): Check if __XSI_VISIBLE is set by sys/cdefs.h, rather than testing for _XOPEN_SOURCE directly, to work correctly when _GNU_SOURCE is set. Index: cygwin/include/cygwin/stdlib.h =================================================================== RCS file: /cvs/src/src/winsup/cygwin/include/cygwin/stdlib.h,v retrieving revision 1.17 diff -u -u -p -r1.17 stdlib.h --- cygwin/include/cygwin/stdlib.h 9 Dec 2013 10:12:42 -0000 1.17 +++ cygwin/include/cygwin/stdlib.h 19 Feb 2015 12:41:00 -0000 @@ -11,6 +11,7 @@ details. */ #ifndef _CYGWIN_STDLIB_H #define _CYGWIN_STDLIB_H +#include #include #ifdef __cplusplus @@ -31,9 +32,7 @@ void setprogname (const char *); char *canonicalize_file_name (const char *); int unsetenv (const char *); #endif /*__STRICT_ANSI__*/ -#if !defined(__STRICT_ANSI__) \ - || (defined(_XOPEN_SOURCE) \ - && ((_XOPEN_SOURCE - 0 >= 500) || defined(_XOPEN_SOURCE_EXTENDED))) +#if !defined(__STRICT_ANSI__) || (__XSI_VISIBLE >= 500) char *initstate (unsigned seed, char *state, size_t size); long random (void); char *setstate (const char *state);