diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2018-06-21 11:25:02 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2018-06-21 12:29:03 -0700 |
commit | 137dda358d40568ba0c2be6db71ee5823ea76fc8 (patch) | |
tree | 9c0ff6565a82c25532d14083bd654363fdde2638 /modules/random_r | |
parent | 29596f8db284a461933f2cff775bc65399f2efbc (diff) | |
download | gnulib-137dda358d40568ba0c2be6db71ee5823ea76fc8.tar.gz |
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.
Diffstat (limited to 'modules/random_r')
-rw-r--r-- | modules/random_r | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/random_r b/modules/random_r index 52a8842795..52becd597b 100644 --- a/modules/random_r +++ b/modules/random_r @@ -6,8 +6,9 @@ lib/random_r.c m4/random_r.m4 Depends-on: +libc-config [test $HAVE_RANDOM_R = 0 || test $REPLACE_RANDOM_R = 1] stdlib -stdint +stdint [test $HAVE_RANDOM_R = 0 || test $REPLACE_RANDOM_R = 1] configure.ac: gl_FUNC_RANDOM_R |