[libcamera-devel] [PATCH] libcamera: Fix compilation with uClibc and uClibc-ng

Niklas Söderlund niklas.soderlund at ragnatech.se
Thu Nov 14 08:47:27 CET 2019


Hi Laurent,

Thanks for your work.

On 2019-11-08 21:47:39 +0200, Laurent Pinchart wrote:
> Neither uClibc nor uClibc-ng support O_TMPFILE. Define it in utils.h if
> not defined.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>

> ---
>  src/libcamera/include/utils.h | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> Is utils.h a good location, or should we create a compat.h (maybe even
> one that is automatically included) for this purpose ?
> 
> diff --git a/src/libcamera/include/utils.h b/src/libcamera/include/utils.h
> index 3efb11c119c2..a80f7d096bf7 100644
> --- a/src/libcamera/include/utils.h
> +++ b/src/libcamera/include/utils.h
> @@ -16,6 +16,15 @@
>  
>  #define ARRAY_SIZE(a)	(sizeof(a) / sizeof(a[0]))
>  
> +#ifndef __DOXYGEN__
> +
> +/* uClibc and uClibc-ng don't provide O_TMPFILE */
> +#ifndef O_TMPFILE
> +#define O_TMPFILE	(020000000 | O_DIRECTORY)
> +#endif
> +
> +#endif
> +
>  namespace libcamera {
>  
>  namespace utils {
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

-- 
Regards,
Niklas Söderlund


More information about the libcamera-devel mailing list