Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N3yzy-0002kg-HF for qemu-devel@nongnu.org; Fri, 30 Oct 2009 17:27:06 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N3yzu-0002k0-VD for qemu-devel@nongnu.org; Fri, 30 Oct 2009 17:27:06 -0400 Received: from [199.232.76.173] (port=42424 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N3yzu-0002jx-PT for qemu-devel@nongnu.org; Fri, 30 Oct 2009 17:27:02 -0400 Received: from cantor2.suse.de ([195.135.220.15]:49900 helo=mx2.suse.de) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N3yzu-0001sk-EY for qemu-devel@nongnu.org; Fri, 30 Oct 2009 17:27:02 -0400 From: Alexander Graf Date: Fri, 30 Oct 2009 22:27:00 +0100 Message-Id: <1256938020-8191-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH] Unbreak tap compilation on OS X List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Cc: Mark McLoughlin , Anthony Liguori , =?utf-8?q?Juha=20Riihim=C3=A4ki?= Currently compiling the tap sources breaks on Mac OS X. This is because of: 1) tap-linux.h requiring Linux includes 2) typos 3) missing #includes This patch adds what's necessary to compile tap happily on Mac OS X. I haven't tested if using tap actually works, but I don't think that's a major issue as that code was probably seriously untested before already. I didn't split the patch, because it's only a few lines of code and splitting is probably not worth the effort here. Signed-off-by: Alexander Graf --- net/tap-bsd.c | 6 ++++-- net/tap-linux.h | 4 ++++ net/tap.c | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/net/tap-bsd.c b/net/tap-bsd.c index 3ad14bb..ac84383 100644 --- a/net/tap-bsd.c +++ b/net/tap-bsd.c @@ -23,7 +23,8 @@ */ #include "net/tap.h" -#incude "qemu-common.h" +#include "qemu-common.h" +#include "sysemu.h" #ifdef __NetBSD__ #include @@ -34,8 +35,9 @@ #else #include #endif -#elif defined (__GLIBC__) && defined (__FreeBSD_kernel__) +#if defined (__GLIBC__) && defined (__FreeBSD_kernel__) #include +#endif #if defined(__OpenBSD__) #include diff --git a/net/tap-linux.h b/net/tap-linux.h index d81c650..f1a0fce 100644 --- a/net/tap-linux.h +++ b/net/tap-linux.h @@ -17,6 +17,8 @@ #define QEMU_TAP_H #include +#ifdef __LINUX__ + #include /* Ioctl defines */ @@ -26,6 +28,8 @@ #define TUNGETIFF _IOR('T', 210, unsigned int) #define TUNSETSNDBUF _IOW('T', 212, int) +#endif + /* TUNSETIFF ifr flags */ #define IFF_TAP 0x0002 #define IFF_NO_PI 0x1000 diff --git a/net/tap.c b/net/tap.c index 60354e4..bdb4a15 100644 --- a/net/tap.c +++ b/net/tap.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include "net.h" -- 1.6.0.2