From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SYgUs-00005H-BY for qemu-devel@nongnu.org; Sun, 27 May 2012 12:39:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SYgUq-00047t-Db for qemu-devel@nongnu.org; Sun, 27 May 2012 12:39:13 -0400 Received: from cantor2.suse.de ([195.135.220.15]:56493 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SYgUq-00047m-7O for qemu-devel@nongnu.org; Sun, 27 May 2012 12:39:12 -0400 Message-ID: <4FC258A8.6080502@suse.de> Date: Sun, 27 May 2012 18:39:04 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1338136323-53160-1-git-send-email-andreas.faerber@web.de> In-Reply-To: <1338136323-53160-1-git-send-email-andreas.faerber@web.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH for-1.1?] slirp: Avoid statements without effect on Big Endian host List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: qemu-devel@nongnu.org Am 27.05.2012 18:32, schrieb Andreas F=C3=A4rber: > Darwin has HTON*/NTOH* macros that on BE simply return the argument. > This is incompatible with SLIRP's use of these macros as a statement. >=20 > Special-case Darwin in the HOST_WORDS_BIGENDIAN code path to redefine > these macros as no-op statement to avoid tons of compiler warnings. >=20 > Signed-off-by: Andreas F=C3=A4rber > --- > slirp/ip.h | 33 ++++++++++++++++++++++----------- > 1 files changed, 22 insertions(+), 11 deletions(-) >=20 > diff --git a/slirp/ip.h b/slirp/ip.h > index 88c903f..6e98b1d 100644 > --- a/slirp/ip.h > +++ b/slirp/ip.h > @@ -34,17 +34,28 @@ > #define _IP_H_ > =20 > #ifdef HOST_WORDS_BIGENDIAN > -# ifndef NTOHL > -# define NTOHL(d) > -# endif > -# ifndef NTOHS > -# define NTOHS(d) > -# endif > -# ifndef HTONL > -# define HTONL(d) > -# endif > -# ifndef HTONS > -# define HTONS(d) > +# if defined(__APPLE__) > +# undef NTOHL > +# undef NTOHS > +# undef HTONL > +# undef HTONS > +# define NTOHL(d) do { } while (0) > +# define NTOHS(d) do { } while (0) > +# define HTONL(d) do { } while (0) > +# define HTONS(d) do { } while (0) > +# else > +# ifndef NTOHL > +# define NTOHL(d) > +# endif > +# ifndef NTOHS > +# define NTOHS(d) > +# endif > +# ifndef HTONL > +# define HTONL(d) > +# endif > +# ifndef HTONS > +# define HTONS(d) > +# endif Ahem, these would have the same issue. v2 coming up. Andreas > # endif > #else > # ifndef NTOHL --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg