[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] io: fix build on FreeBSD
From: |
Ed Maste |
Subject: |
Re: [Qemu-devel] [PATCH] io: fix build on FreeBSD |
Date: |
Fri, 26 Feb 2016 09:25:52 -0500 |
On 25 February 2016 at 11:41, Daniel P. Berrange <address@hidden> wrote:
> On Thu, Feb 25, 2016 at 09:37:18AM -0700, Eric Blake wrote:
>>
>> Oh, right. That's annoying. What about:
>>
>> #ifndef EAI_ADDRFAMILY
>> #define EAI_ADDRFAMILY 0
>> #endif
>>
>> if ((EAI_ADDRFAMILY && gaierr == EAIADDRFAMILY) ||
>> gaierr == EAI_FAMILY...
>>
>> to shut up gcc 6, while still hoisting the preprocessor logic outside of
>> the expression?
>
> To be honest, I think the preprocessor check inside the expression isn't
> a big deal and clearer than playing games like this.
I wasn't a fan of putting the preprocessor check inside the expression
either, but no clear and concise alternative came to mind. I think
it's easier to see both intent and effect with the preoprocessor check
than with the above.