All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Jan Kiszka <jan.kiszka@web.de>, qemu-devel@nongnu.org
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	[thread overview]
Message-ID: <4FC3864A.8040203@suse.de> (raw)
In-Reply-To: <CAFEAcA-yJAdGg3VcHyL6G-TD9RqaPkxxsixnObxLHXtzHNhqEg@mail.gmail.com>

Am 28.05.2012 14:00, schrieb Peter Maydell:
> On 28 May 2012 12:47, Jan Kiszka <jan.kiszka@web.de> wrote:
>> On 2012-05-28 00:10, Peter Maydell wrote:
>>> On 27 May 2012 17:42, Andreas Färber <andreas.faerber@web.de> 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	other threads:[~2012-05-28 14:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-27 16:42 [Qemu-devel] [PATCH for-1.1? v2] slirp: Avoid statements without effect on Big Endian host Andreas Färber
2012-05-27 22:10 ` Peter Maydell
2012-05-28 11:47   ` Jan Kiszka
2012-05-28 12:00     ` Peter Maydell
2012-05-28 14:06       ` Andreas Färber [this message]
2012-05-28 15:18     ` Andreas Färber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FC3864A.8040203@suse.de \
    --to=afaerber@suse.de \
    --cc=jan.kiszka@web.de \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.