From ecf453f9635fb278cff4d4bae21a1e249313b817 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 22 Mar 2016 17:50:48 -0500 Subject: Add simple versions of random() and srandom() Prototypes also added for initstate() and setstate() but they were not implemented in the shared newlib code. * newlib/libc/include/cygwin/stdlib.h: Prototypes added. * winsup/cygwin/include/cygwin/stdlib.h: Prototypes removed. * newlib/libc/stdlib/random.c: New file. * newlib/libc/machine/epiphany/machine/stdlib.h: Removed * newlib/libc/stdlib/Makefile.am: Added random.c. * newlib/libc/stdlib/stdlib.tex: Added random.def. * newlib/libc/stdlib/Makefile.in: Regenerated. --- newlib/libc/include/stdlib.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'newlib/libc/include/stdlib.h') diff --git a/newlib/libc/include/stdlib.h b/newlib/libc/include/stdlib.h index 363b7df4b..3194d6bc5 100644 --- a/newlib/libc/include/stdlib.h +++ b/newlib/libc/include/stdlib.h @@ -226,6 +226,12 @@ unsigned short * _VOID _EXFUN(srand48,(long)); _VOID _EXFUN(_srand48_r,(struct _reent *, long)); #endif /* __SVID_VISIBLE || __XSI_VISIBLE */ +#if __SVID_VISIBLE || __XSI_VISIBLE >= 4 || __BSD_VISIBLE +char * _EXFUN(initstate,(unsigned, char *, size_t)); +long _EXFUN(random,(_VOID)); +char * _EXFUN(setstate,(char *)); +_VOID _EXFUN(srandom,(unsigned)); +#endif #if __ISO_C_VISIBLE >= 1999 long long _EXFUN(atoll,(const char *__nptr)); #endif -- cgit v1.2.3