]> git.proxmox.com Git - qemu.git/blobdiff - osdep.c
win32: Add missing function ffs
[qemu.git] / osdep.c
diff --git a/osdep.c b/osdep.c
index abbc8a2381a0d84b535a44c9264384c3c9cb6084..dbf872aea79b999312f9d1d590c92ef0e4fef009 100644 (file)
--- 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)