This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add simple versions of random() and srandom()


On 03/23/2016 01:04 AM, Yaakov Selkowitz wrote:
On 2016-03-22 17:51, Joel Sherrill wrote:
Prototypes also added for initstate() and setstate() but they
were not implemented.

This should allow Cygwin to remove its own declarations of these functions.

+#if __SVID_VISIBLE || __XSI_VISIBLE >= 4 || __BSD_VISIBLE

#if __MISC_VISIBLE || __XSI_VISIBLE >= 500
No, the value 4 is actually the right one. At first look I had also thought that it needed to be 500, but it originated in issue 4 as an X/OPEN UNIX extension (see http://pubs.opengroup.org/onlinepubs/9699919799/functions/random.html), and was moved to BASE in issue 5. features.h has, in part
#elif (_XOPEN_SOURCE - 0) >= 500
#define __XSI_VISIBLE           500
#elif defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)
#define __XSI_VISIBLE           4
I did not directly check the _XOPEN_SOURCE_EXTENDED, but it sounds right, so 4 does look right.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]