From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52959) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMZHP-0007TF-5E for qemu-devel@nongnu.org; Sat, 26 May 2018 09:30:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMZHO-0007Ak-6m for qemu-devel@nongnu.org; Sat, 26 May 2018 09:30:43 -0400 Received: from mail-ot0-x241.google.com ([2607:f8b0:4003:c0f::241]:33790) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fMZHO-0007AG-1a for qemu-devel@nongnu.org; Sat, 26 May 2018 09:30:42 -0400 Received: by mail-ot0-x241.google.com with SMTP id l22-v6so9056082otj.0 for ; Sat, 26 May 2018 06:30:41 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Peter Maydell Date: Sat, 26 May 2018 14:30:20 +0100 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 01/13] 9p: linux: Fix a couple Linux assumptions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= Cc: keno@juliacomputing.com, QEMU Developers , Keno Fischer , Greg Kurz On 26 May 2018 at 07:30, Philippe Mathieu-Daud=C3=A9 wrot= e: > Hi Keno, > > On 05/26/2018 02:23 AM, keno@juliacomputing.com wrote: >> From: Keno Fischer >> >> - 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 >> --- >> 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 >> #include >> +#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