From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35183) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SZ0aQ-00071y-Cp for qemu-devel@nongnu.org; Mon, 28 May 2012 10:06:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SZ0aJ-0003gj-Az for qemu-devel@nongnu.org; Mon, 28 May 2012 10:06:17 -0400 Received: from cantor2.suse.de ([195.135.220.15]:51059 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SZ0aJ-0003fz-4A for qemu-devel@nongnu.org; Mon, 28 May 2012 10:06:11 -0400 Message-ID: <4FC3864A.8040203@suse.de> Date: Mon, 28 May 2012 16:06:02 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1338136940-53279-1-git-send-email-andreas.faerber@web.de> <4FC365D6.80205@web.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH for-1.1? v2] slirp: Avoid statements without effect on Big Endian host List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Jan Kiszka , qemu-devel@nongnu.org Am 28.05.2012 14:00, schrieb Peter Maydell: > On 28 May 2012 12:47, Jan Kiszka wrote: >> On 2012-05-28 00:10, Peter Maydell wrote: >>> On 27 May 2012 17:42, Andreas F=C3=A4rber wr= ote: >>>> +# 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 >>> >>> We could just use this for everything, not just if __APPLE__, >>> right? For big-endian the semantics we want are always "do >>> nothing" so it's always OK to undef and redefine... >>> That would save having a special case. >> >> Yes, please. >=20 > It occurred to me that you could also have the unconditional > #undefs outside the #ifdef HOST_WORDS_BIGENDIAN, but that > is starting to stray outside of the "simple fix for 1.1" > territory. For 1.2 I would suggest to go even further and drop these SLIRP-specific macros in favor of QEMU-wide available ones. static inline functions would've avoided the problem in the first place. Andreas --=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