]> Savannah Git Hosting - gnulib.git/commitdiff
sys_random: Work around an uClibc bug.
authorBruno Haible <bruno@clisp.org>
Thu, 13 Aug 2020 15:49:35 +0000 (17:49 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 13 Aug 2020 15:49:35 +0000 (17:49 +0200)
Reported by akater <nuclearspace@gmail.com>
via Stefan Kangas <stefan@marxist.se>
in <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=42236>.

* lib/sys_random.in.h: On uClibc, include <stddef.h> first.
* m4/sys_random_h.m4 (gl_HEADER_SYS_RANDOM): Update comment.
* m4/getrandom.m4 (gl_FUNC_GETRANDOM): Likewise.
* doc/glibc-headers/sys_random.texi: Mention the uClibc bug.

ChangeLog
doc/glibc-headers/sys_random.texi
lib/sys_random.in.h
m4/getrandom.m4
m4/sys_random_h.m4

index c0cee5fe53c181b53d5953150f28e039fc57c215..884be61ee1096619b3b23c3450be6341d6eaa37d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2020-08-13  Bruno Haible  <bruno@clisp.org>
+
+       sys_random: Work around an uClibc bug.
+       Reported by akater <nuclearspace@gmail.com>
+       via Stefan Kangas <stefan@marxist.se>
+       in <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=42236>.
+       * lib/sys_random.in.h: On uClibc, include <stddef.h> first.
+       * m4/sys_random_h.m4 (gl_HEADER_SYS_RANDOM): Update comment.
+       * m4/getrandom.m4 (gl_FUNC_GETRANDOM): Likewise.
+       * doc/glibc-headers/sys_random.texi: Mention the uClibc bug.
+
 2020-08-12  Bruno Haible  <bruno@clisp.org>
 
        Avoid implicit conversion from 'unsigned int' to 'int' in initializers.
index f533a7abf72ccaf61d4d7b3428526c5ffa7f1430..df5d684fd962d7229e63f78484882622ec209585 100644 (file)
@@ -25,7 +25,7 @@ This header file is missing on some platforms:
 glibc 2.24, NetBSD 9.0, OpenBSD 3.8, Minix 3.1.8, AIX 7.1, HP-UX 11.11, IRIX 6.5, Cygwin 2.6.x, mingw, MSVC 14.
 @item
 This header file is not self-contained on some platforms:
-Mac OS X 10.13.
+uClibc, Mac OS X 10.13.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 290fa3938e6803dae62e7b429f33e129bf12e60e..a8469cf5cc81bf1c4b473b4dca64a5511c653437 100644 (file)
 
 #if @HAVE_SYS_RANDOM_H@
 
+/* On uClibc, <sys/random.h> assumes prior inclusion of <stddef.h>.  */
+# if defined __UCLIBC__
+#  include <stddef.h>
+# endif
 /* On Mac OS X 10.5, <sys/random.h> assumes prior inclusion of <sys/types.h>.
    On Max OS X 10.13, <sys/random.h> assumes prior inclusion of a file that
    includes <Availability.h>, such as <stdlib.h> or <unistd.h>.  */
index 424c2fad3e3dd7ec8d302c47d1c7698da96d7e68..d6da71a2c83ed354cbc2a796c7fbf008342fbf5e 100644 (file)
@@ -1,4 +1,4 @@
-# getrandom.m4 serial 7
+# getrandom.m4 serial 8
 dnl Copyright 2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -18,7 +18,8 @@ AC_DEFUN([gl_FUNC_GETRANDOM],
       [gl_cv_func_getrandom_ok],
       [AC_COMPILE_IFELSE(
          [AC_LANG_PROGRAM(
-            [[/* Additional includes are needed before <sys/random.h> on Mac OS X.  */
+            [[/* Additional includes are needed before <sys/random.h> on uClibc
+                 and Mac OS X.  */
               #include <sys/types.h>
               #include <stdlib.h>
               #include <sys/random.h>
index a964b157841a6cdb804c07f1cb7cae01ddfc84bd..8c5d53703beaf92749205f0e1dceddcafa76b7c3 100644 (file)
@@ -1,4 +1,4 @@
-# sys_random_h.m4 serial 4
+# sys_random_h.m4 serial 5
 dnl Copyright (C) 2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -25,7 +25,8 @@ AC_DEFUN([gl_HEADER_SYS_RANDOM],
   dnl corresponding gnulib module is not in use.
   gl_WARN_ON_USE_PREPARE([[
 #if HAVE_SYS_RANDOM_H
-/* Additional includes are needed before <sys/random.h> on Mac OS X.  */
+/* Additional includes are needed before <sys/random.h> on uClibc
+   and Mac OS X.  */
 # include <sys/types.h>
 # include <stdlib.h>
 # include <sys/random.h>