diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2021-11-30 17:50:01 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2021-11-30 17:50:21 -0800 |
commit | 135414a7f543e4d40ad0a7cbd51885e159a6e0f4 (patch) | |
tree | 59274f51c0f50c3d567623987be74f2c3d3a81b0 /lib | |
parent | db493d1ce43fc39dd925699d840c80b3400f4313 (diff) | |
download | gnulib-135414a7f543e4d40ad0a7cbd51885e159a6e0f4.tar.gz |
sys_random: port better to uClibc < 1.0.35
Problem reported by Fabrice Fontaine in:
https://lists.gnu.org/r/bug-gnulib/2021-11/msg00043.html
* lib/sys_random.in.h [HAVE_SYS_RANDOM_H && !__GLIBC__ && __UCLIBC__]:
Include <stddef.h>, in case this file is included before
__UCLIBC__ is defined.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sys_random.in.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sys_random.in.h b/lib/sys_random.in.h index 1abd6c544e..8b4b934a1e 100644 --- a/lib/sys_random.in.h +++ b/lib/sys_random.in.h @@ -23,8 +23,10 @@ #if @HAVE_SYS_RANDOM_H@ -/* On uClibc, <sys/random.h> assumes prior inclusion of <stddef.h>. */ -# if defined __UCLIBC__ +/* On uClibc < 1.0.35, <sys/random.h> assumes prior inclusion of <stddef.h>. + Do not use __UCLIBC__ here, as it might not be defined yet. + But avoid namespace pollution on glibc systems. */ +# ifndef __GLIBC__ # include <stddef.h> # endif /* On Mac OS X 10.5, <sys/random.h> assumes prior inclusion of <sys/types.h>. |