Re: [PATCH v2 1/5] config-post.h: define __GNUC_PREREQ if not defined

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  Fabian Freyer wrote:

> Several gnulib headers rely on feature.h being included by ctype.h to provide
> __GNUC_PREREQ, but on systems without glibc, this is not provided. In these
> cases __GNUC_PREREQ gets redefined to 0, which causes build errors from checks
> in src/internal.h.
> Therefore, define __GNUC_PREREQ as early as possible. config.h is probably the
> first header that is included, before any other headers.

Just like Eric said, it's worth to report that to gnulib. Meanwhile, I
think it would be good to prepend some comment before this __GNUC_PREREQ
so readers of the code could understand easily where it's coming from.

> ---
>  config-post.h | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/config-post.h b/config-post.h
> index 2398d3d..0aa8271 100644
> --- a/config-post.h
> +++ b/config-post.h
> @@ -67,3 +67,14 @@
>  # undef WITH_SECDRIVER_APPARMOR
>  # undef WITH_CAPNG
>  #endif /* LIBVIRT_NSS */
> +
> +#ifdef __GNUC__
> +# ifndef __GNUC_PREREQ
> +#  if defined __GNUC__ && defined __GNUC_MINOR__
> +#   define __GNUC_PREREQ(maj, min)                                        \
> +   ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
> +#  else
> +#   define __GNUC_PREREQ(maj, min) 0
> +#  endif
> +# endif
> +#endif
> -- 
> 2.7.0
> 
> --
> libvir-list mailing list
> libvir-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/libvir-list

Roman Bogorodskiy

Attachment: signature.asc
Description: PGP signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]