Skip to contentSkip to conversation

w32: Fix missing declaration of ffs()

PATCH Applied Stefan Weil 2 participants 2 messages May 15, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 w32: Fix missing declaration of ffs()

target-ppc/cpu.h now needs ffs(), too, so ffs() must be declared before this file is included.

Moving the declaration from qemu-common.h to qemu-os-win32.h (which is included in qemu-common.h early) fixes the compiler warning for w32.

Cc Aurelien Jarno <[email protected]>
---
 qemu-common.h   |    5 -----
 qemu-os-win32.h |    3 +++
 2 files changed, 3 insertions(+), 5 deletions(-)
qemu-common.h +0 -5
index f9f705d..bba8dfe 100644
@@ -201,11 +201,6 @@ const char *path(const char *pathname);
 #define qemu_isascii(c)		isascii((unsigned char)(c))
 #define qemu_toascii(c)		toascii((unsigned char)(c))
 
-#ifdef _WIN32
-/* ffs() in oslib-win32.c for WIN32, strings.h for the rest of the world */
-int ffs(int i);
-#endif
-
 void *qemu_oom_check(void *ptr);
 void *qemu_malloc(size_t size);
 void *qemu_realloc(void *ptr, size_t size);
qemu-os-win32.h +3 -0
index ed2753d..8a069d7 100644
@@ -29,6 +29,9 @@
 #include <windows.h>
 #include <winsock2.h>
 
+/* Declaration of ffs() is missing in MinGW's strings.h. */
+int ffs(int i);
+
 /* Polling handling */
 
 /* return TRUE if no sleep should be done afterwards */
Signature · 1 line
1.5.6.5
#1 lore raw
Quoted 7 lines · Stefan Weil

target-ppc/cpu.h now needs ffs(), too, so ffs() must be declared before this file is included.

Moving the declaration from qemu-common.h to qemu-os-win32.h (which is included in qemu-common.h early) fixes the compiler warning for w32.

Quoted 6 lines
Cc Aurelien Jarno <[email protected]>
---
 qemu-common.h   |    5 -----
 qemu-os-win32.h |    3 +++
 2 files changed, 3 insertions(+), 5 deletions(-)

Thanks, applied.

Quoted 34 lines
qemu-common.h +0 -5
index f9f705d..bba8dfe 100644
@@ -201,11 +201,6 @@ const char *path(const char *pathname);
 #define qemu_isascii(c)		isascii((unsigned char)(c))
 #define qemu_toascii(c)		toascii((unsigned char)(c))
 
-#ifdef _WIN32
-/* ffs() in oslib-win32.c for WIN32, strings.h for the rest of the world */
-int ffs(int i);
-#endif
-
 void *qemu_oom_check(void *ptr);
 void *qemu_malloc(size_t size);
 void *qemu_realloc(void *ptr, size_t size);
qemu-os-win32.h +3 -0
index ed2753d..8a069d7 100644
@@ -29,6 +29,9 @@
 #include <windows.h>
 #include <winsock2.h>
 
+/* Declaration of ffs() is missing in MinGW's strings.h. */
+int ffs(int i);
+
 /* Polling handling */
 
 /* return TRUE if no sleep should be done afterwards */
Signature · 1 line
1.5.6.5
Signature · 2 lines
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net