From: Alexander Graf Date: Fri, 30 Oct 2009 21:27:00 +0000 (+0100) Subject: Unbreak tap compilation on OS X X-Git-Tag: TizenStudio_2.0_p2.3.2~208^2~9852 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=71f4effce79ec0485586963ea764f2c212c72f26;p=sdk%2Femulator%2Fqemu.git Unbreak tap compilation on OS X 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 Signed-off-by: Anthony Liguori --- 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"