[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 01/13] 9p: linux: Fix a couple Linux assumptions
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 01/13] 9p: linux: Fix a couple Linux assumptions |
Date: |
Sat, 26 May 2018 14:30:20 +0100 |
On 26 May 2018 at 07:30, Philippe Mathieu-Daudé <address@hidden> wrote:
> Hi Keno,
>
> On 05/26/2018 02:23 AM, address@hidden wrote:
>> From: Keno Fischer <address@hidden>
>>
>> - 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 <address@hidden>
>> ---
>> 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
[Qemu-devel] [PATCH 04/13] 9p: darwin: Handle struct stat(fs) differences, keno, 2018/05/26