From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=35470 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ORtNc-0005V4-Bq for qemu-devel@nongnu.org; Thu, 24 Jun 2010 16:50:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ORtNa-0002t1-AO for qemu-devel@nongnu.org; Thu, 24 Jun 2010 16:50:36 -0400 Received: from moutng.kundenserver.de ([212.227.17.8]:58799) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ORtNZ-0002sp-Pn for qemu-devel@nongnu.org; Thu, 24 Jun 2010 16:50:34 -0400 Message-ID: <4C23C513.3050606@mail.berlios.de> Date: Thu, 24 Jun 2010 22:50:27 +0200 From: Stefan Weil MIME-Version: 1.0 References: <4C12AC11.4090402@twiddle.net> <1276351632-8072-1-git-send-email-weil@mail.berlios.de> In-Reply-To: <1276351632-8072-1-git-send-email-weil@mail.berlios.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] win32: Add missing function ffs List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: QEMU Developers 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 > Signed-off-by: Stefan Weil > --- > 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