]> Savannah Git Hosting - gnulib.git/commitdiff
sys_random: port better to uClibc < 1.0.35
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 1 Dec 2021 01:50:01 +0000 (17:50 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 1 Dec 2021 01:50:21 +0000 (17:50 -0800)
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.

ChangeLog
lib/sys_random.in.h

index efc289fa66d131b8c96229b1fdbf7db4f94dbd30..82819f801f3f31e131083a810d2fab32f0053a59 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2021-11-30  Paul Eggert  <eggert@cs.ucla.edu>
+
+       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.
+
 2021-11-27  Paul Eggert  <eggert@cs.ucla.edu>
 
        gettext-h: document GNULIB_NO_VLA
index 1abd6c544e05b4f2d213ff1b7e41e778ce4158a7..8b4b934a1e77c06624c2ef9dfaecd135b710f6a6 100644 (file)
 
 #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>.