From: "Daniel P. Berrange" <berrange@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: Ed Maste <emaste@freebsd.org>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] io: fix build on FreeBSD
Date: Thu, 25 Feb 2016 16:32:02 +0000 [thread overview]
Message-ID: <20160225163202.GI10515@redhat.com> (raw)
In-Reply-To: <56CF2BCE.6090504@redhat.com>
On Thu, Feb 25, 2016 at 09:29:02AM -0700, Eric Blake wrote:
> 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 <emaste@freebsd.org>
> > ---
> > 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?
I think that'll cause gcc 6 to whine about you checking the same
value twice in the conditional, like how it complains that EWOULDBLOCK
and EAGAIN are the same.
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
next prev parent reply other threads:[~2016-02-25 16:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-25 15:31 [Qemu-devel] [PATCH] io: fix build on FreeBSD Ed Maste
2016-02-25 15:46 ` Daniel P. Berrange
2016-02-25 16:29 ` Eric Blake
2016-02-25 16:32 ` Daniel P. Berrange [this message]
2016-02-25 16:37 ` Eric Blake
2016-02-25 16:41 ` Daniel P. Berrange
2016-02-26 14:25 ` Ed Maste
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160225163202.GI10515@redhat.com \
--to=berrange@redhat.com \
--cc=eblake@redhat.com \
--cc=emaste@freebsd.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).