qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: Alexander Graf <agraf@suse.de>
Cc: Marcelo Tosatti <mtosatti@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Fix leul_to_cpu on big endian hosts
Date: Mon, 31 May 2010 20:43:45 +0200	[thread overview]
Message-ID: <20100531184345.GU4621@ohm.aurel32.net> (raw)
In-Reply-To: <1273592297-18370-1-git-send-email-agraf@suse.de>

On Tue, May 11, 2010 at 05:38:17PM +0200, Alexander Graf wrote:
> Commit 213acd2e introduced leul_to_cpu with a special code path for big endian
> hosts. Unfortunately that code used preprocessor magic that didn't work.
> 
> This patch replaces the explicit ##s by glue() which is proven to work reliably,
> enabling me to compile qemu on ppc again.
> 
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
>  bswap.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/bswap.h b/bswap.h
> index 956f3fa..20caae6 100644
> --- a/bswap.h
> +++ b/bswap.h
> @@ -205,7 +205,7 @@ static inline void cpu_to_be32wu(uint32_t *p, uint32_t v)
>  
>  #ifdef HOST_WORDS_BIGENDIAN
>  #define cpu_to_32wu cpu_to_be32wu
> -#define leul_to_cpu(v) le ## HOST_LONG_BITS ## _to_cpu(v)
> +#define leul_to_cpu(v) glue(glue(le,HOST_LONG_BITS),_to_cpu)(v)
>  #else
>  #define cpu_to_32wu cpu_to_le32wu
>  #define leul_to_cpu(v) (v)

While the patch looks correct, I am not able to reproduce the issue. Do
you have more details about it?

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

  parent reply	other threads:[~2010-05-31 18:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-11 15:38 [Qemu-devel] [PATCH] Fix leul_to_cpu on big endian hosts Alexander Graf
2010-05-31 18:38 ` Alexander Graf
2010-05-31 18:43 ` Aurelien Jarno [this message]
2010-05-31 18:44   ` Alexander Graf
2010-05-31 18:58     ` Aurelien Jarno

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=20100531184345.GU4621@ohm.aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=agraf@suse.de \
    --cc=mtosatti@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).