From patchwork Sat Jun 12 14:07:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 55397 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A5DB2B7D8C for ; Sun, 13 Jun 2010 00:13:18 +1000 (EST) Received: from localhost ([127.0.0.1]:45636 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ONRON-0006BO-GZ for incoming@patchwork.ozlabs.org; Sat, 12 Jun 2010 10:08:59 -0400 Received: from [140.186.70.92] (port=48953 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ONRMw-0005it-6E for qemu-devel@nongnu.org; Sat, 12 Jun 2010 10:07:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ONRMu-0000aY-Iw for qemu-devel@nongnu.org; Sat, 12 Jun 2010 10:07:30 -0400 Received: from moutng.kundenserver.de ([212.227.126.187]:53412) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ONRMu-0000aC-6s for qemu-devel@nongnu.org; Sat, 12 Jun 2010 10:07:28 -0400 Received: from flocke.weilnetz.de (p54ADE817.dip.t-dialin.net [84.173.232.23]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0LrGCe-1PQJ291NRE-013X90; Sat, 12 Jun 2010 16:07:25 +0200 Received: from stefan by flocke.weilnetz.de with local (Exim 4.71) (envelope-from ) id 1ONRMn-00026k-Vl; Sat, 12 Jun 2010 16:07:22 +0200 From: Stefan Weil To: QEMU Developers Date: Sat, 12 Jun 2010 16:07:12 +0200 Message-Id: <1276351632-8072-1-git-send-email-weil@mail.berlios.de> X-Mailer: git-send-email 1.7.1 In-Reply-To: <4C12AC11.4090402@twiddle.net> References: <4C12AC11.4090402@twiddle.net> X-Provags-ID: V01U2FsdGVkX19XejY7YygXEXOwNP8ktgJqZ2nninm57mOtmFh rslUgE1u0y5K2R21Rn04RgDe3a8jJQiQeFNA4UZZ10auuk6vDq Ul4kVb8lj/adISmQCEh/DYrQJ2pSahKHwUlXC3XJTomH2XRS57 hNQ== X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Richard Henderson Subject: [Qemu-devel] [PATCH] win32: Add missing function ffs X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Acked-by: Richard Henderson --- 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)