qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH] win32: Add missing function ffs


From: Stefan Weil
Subject: [Qemu-devel] Re: [PATCH] win32: Add missing function ffs
Date: Thu, 24 Jun 2010 22:50:27 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100515 Iceowl/1.0b1 Icedove/3.0.4

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<address@hidden>
Signed-off-by: Stefan Weil<address@hidden>
---
  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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]