On 26 May 2018 at 07:30, Philippe Mathieu-Daudé <f4...@amsat.org> wrote:
> Hi Keno,
>
> On 05/26/2018 02:23 AM, k...@juliacomputing.com wrote:
>> From: Keno Fischer <k...@alumni.harvard.edu>
>>
>>  - Guard two Linux only headers.
>>  - Define `ENOATTR` only if not only defined
>>    (it's defined in system headers on Darwin).
>>
>> Signed-off-by: Keno Fischer <k...@juliacomputing.com>
>> ---
>>  fsdev/file-op-9p.h   | 2 ++
>>  hw/9pfs/9p-local.c   | 2 ++
>>  include/qemu/xattr.h | 4 +++-
>>  3 files changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/fsdev/file-op-9p.h b/fsdev/file-op-9p.h
>> index 3fa062b..a13e729 100644
>> --- a/fsdev/file-op-9p.h
>> +++ b/fsdev/file-op-9p.h
>> @@ -16,7 +16,9 @@
>>
>>  #include <dirent.h>
>>  #include <utime.h>
>> +#ifdef CONFIG_LINUX
>
> What about a less restrictive:
>
> #ifndef __APPLE__

In general I would recommend checking for specific
features (usually in configure), rather than adding
ifdef tests for particular OSes. In this case presumably
we're including these headers because we're after
a specific function or define or whatever, so we can
check in configure for what header that's in (or
if it's not available at all).

thanks
-- PMM

Reply via email to