[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] lib/getrandom.c: fix build with uclibc < 1.0.35
From: |
Fabrice Fontaine |
Subject: |
Re: [PATCH] lib/getrandom.c: fix build with uclibc < 1.0.35 |
Date: |
Tue, 30 Nov 2021 22:52:03 +0100 |
Le mar. 30 nov. 2021 à 22:46, Paul Eggert <eggert@cs.ucla.edu> a écrit :
>
> On 11/30/21 13:36, Fabrice Fontaine wrote:
> > Should I send a new patch ?
>
> Would something like the following work?
Yes, I can confirm that the build failure is fixed with this patch.
>
> diff --git a/lib/sys_random.in.h b/lib/sys_random.in.h
> index 1abd6c544e..fdc84e0806 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, <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>.