diff mbox

w32: Fix missing declaration of ffs()

Message ID 1305445919-10146-1-git-send-email-weil@mail.berlios.de
State Accepted
Headers show

Commit Message

Stefan Weil May 15, 2011, 7:51 a.m. UTC
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 <aurelien@aurel32.net>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 qemu-common.h   |    5 -----
 qemu-os-win32.h |    3 +++
 2 files changed, 3 insertions(+), 5 deletions(-)

Comments

Aurelien Jarno May 15, 2011, 10:51 a.m. UTC | #1
On Sun, May 15, 2011 at 09:51:59AM +0200, Stefan Weil wrote:
> 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 <aurelien@aurel32.net>
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
> ---
>  qemu-common.h   |    5 -----
>  qemu-os-win32.h |    3 +++
>  2 files changed, 3 insertions(+), 5 deletions(-)

Thanks, applied.

> diff --git a/qemu-common.h b/qemu-common.h
> index f9f705d..bba8dfe 100644
> --- a/qemu-common.h
> +++ b/qemu-common.h
> @@ -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);
> diff --git a/qemu-os-win32.h b/qemu-os-win32.h
> index ed2753d..8a069d7 100644
> --- a/qemu-os-win32.h
> +++ b/qemu-os-win32.h
> @@ -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 */
> -- 
> 1.5.6.5
> 
>
diff mbox

Patch

diff --git a/qemu-common.h b/qemu-common.h
index f9f705d..bba8dfe 100644
--- a/qemu-common.h
+++ b/qemu-common.h
@@ -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);
diff --git a/qemu-os-win32.h b/qemu-os-win32.h
index ed2753d..8a069d7 100644
--- a/qemu-os-win32.h
+++ b/qemu-os-win32.h
@@ -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 */