[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] io: fix build on FreeBSD
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH] io: fix build on FreeBSD |
Date: |
Thu, 25 Feb 2016 09:29:02 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
On 02/25/2016 08:31 AM, Ed Maste wrote:
> EAI_ADDRFAMILY is obsolete and FreeBSD/s netdb.h does not provide a
> definition.
>
> Signed-off-by: Ed Maste <address@hidden>
> ---
> tests/test-io-channel-socket.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/tests/test-io-channel-socket.c b/tests/test-io-channel-socket.c
> index 0697363..f4dbd60 100644
> --- a/tests/test-io-channel-socket.c
> +++ b/tests/test-io-channel-socket.c
> @@ -63,7 +63,10 @@ static int check_protocol_support(bool *has_ipv4, bool
> *has_ipv6)
>
> gaierr = getaddrinfo("::1", NULL, &hints, &ai);
> if (gaierr != 0) {
> - if (gaierr == EAI_ADDRFAMILY ||
> + if (
> +#ifdef EAI_ADDRFAMILY
> + gaierr == EAI_ADDRFAMILY ||
> +#endif
> gaierr == EAI_FAMILY ||
I'm not the biggest-fan of mid-expression #ifdefs. Can we rewrite this
to look more like:
#ifndef EAI_ADDRFAMILY
#define EAI_ADDRFAMILY EAI_FAMILY
#endif
and leave the conditional expression unchanged?
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature