qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <weil@mail.berlios.de>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: [Qemu-devel] Re: [PATCH] win32: Add missing function ffs
Date: Thu, 24 Jun 2010 22:50:27 +0200	[thread overview]
Message-ID: <4C23C513.3050606@mail.berlios.de> (raw)
In-Reply-To: <1276351632-8072-1-git-send-email-weil@mail.berlios.de>

Am 12.06.2010 16:07, schrieb Stefan Weil:
> mingw32 does not include function ffs.
>
> Commit c6d29ad6e24533cc3762e1d654275607e1d03058 added a
> declaration for ffs, but an implementation was missing.
>
> For compilations with optimization, the compiler creates
> inline code, so the implementation is not always needed.
>
> Without optimization, linking fails without this patch.
>
> v2: Use __builtin_ffs as suggested by Richard Henderson
>
> Cc: Richard Henderson<rth@twiddle.net>
> Signed-off-by: Stefan Weil<weil@mail.berlios.de>
> ---
>   osdep.c |    7 +++++++
>   1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/osdep.c b/osdep.c
> index abbc8a2..dbf872a 100644
> --- a/osdep.c
> +++ b/osdep.c
> @@ -167,6 +167,13 @@ int qemu_create_pidfile(const char *filename)
>
>   #ifdef _WIN32
>
> +/* mingw32 needs ffs for compilations without optimization. */
> +int ffs(int i)
> +{
> +    /* Use gcc's builtin ffs. */
> +    return __builtin_ffs(i);
> +}
> +
>   /* Offset between 1/1/1601 and 1/1/1970 in 100 nanosec units */
>   #define _W32_FT_OFFSET (116444736000000000ULL)
>
>    

Ping. The patch should be applied to qemu master.

Thanks,
Stefan

  parent reply	other threads:[~2010-06-24 20:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-11 20:57 [Qemu-devel] [PATCH] win32: Add missing function ffs Stefan Weil
2010-06-11 21:35 ` Richard Henderson
2010-06-12 14:07   ` Stefan Weil
2010-06-12 15:52     ` [Qemu-devel] " Richard Henderson
2010-06-24 20:50     ` Stefan Weil [this message]
2010-06-27 20:25       ` Blue Swirl

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=4C23C513.3050606@mail.berlios.de \
    --to=weil@mail.berlios.de \
    --cc=aliguori@us.ibm.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).