qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-1.1? v2] slirp: Avoid statements without eff


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH for-1.1? v2] slirp: Avoid statements without effect on Big Endian host
Date: Mon, 28 May 2012 16:06:02 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120421 Thunderbird/12.0

Am 28.05.2012 14:00, schrieb Peter Maydell:
> On 28 May 2012 12:47, Jan Kiszka <address@hidden> wrote:
>> On 2012-05-28 00:10, Peter Maydell wrote:
>>> On 27 May 2012 17:42, Andreas Färber <address@hidden> wrote:
>>>> +# 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.
> 
> 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

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]