]> Savannah Git Hosting - gnulib.git/commit
random, random_r: merge from glibc
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 21 Jun 2018 18:25:02 +0000 (11:25 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 21 Jun 2018 19:29:03 +0000 (12:29 -0700)
commit137dda358d40568ba0c2be6db71ee5823ea76fc8
tree9c0ff6565a82c25532d14083bd654363fdde2638
parent29596f8db284a461933f2cff775bc65399f2efbc
random, random_r: merge from glibc

* lib/random.c, lib/random_r.c:
Include libc-config.h if !_LIBC, not config.h unilaterally.
* lib/random.c:
Do not include stdint.h or time.h; not needed.
Include libc-lock.h if _LIBC, and define substitute macros otherwise.
(unsafe_state): Rename from generator.  All uses changed.
Use C99-style initializers.
(__random, __srandom, __initstate, __setstate): Rename from
non-underscored version, but define it to non-underscored version
on Gnulib.  Add a lock.
* lib/random_r.c (__srandom_r, __initstate_r, __setstate_r, __random_r):
Likewise.
Do not include <stdint.h>; not needed since stdlib.h defines int32_t.
(weak_alias, __set_errno) [!_LIBC]: Remove; now done by libc-config.
(__srandom_r): Use int32_t instead of long int where int32_t will do.
(__random_r): Use uint32 to fix glibc bug 17343.
* modules/random, modules/random_r (Depends-on): Add libc-config.
Depend on stdint only if $HAVE_RANDOM = 0.
ChangeLog
lib/random.c
lib/random_r.c
modules/random
modules/random_r