qemu-trivial
[Top][All Lists]
Advanced

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

Re: [Qemu-trivial] [Qemu-devel] [PATCH] w32: include winsock2.h before w


From: Stefan Weil
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] w32: include winsock2.h before windows.h
Date: Tue, 9 Feb 2016 17:03:09 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0

Am 09.02.2016 um 15:16 schrieb Paolo Bonzini:
> Recent Fedora complains while compiling ui/sdl.c:
>
>     /usr/x86_64-w64-mingw32/sys-root/mingw/include/winsock2.h:15:2: warning: 
> #warning Please include winsock2.h before windows.h [-Wcpp]
>
> And with this patch we dutifully obey.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
>  include/sysemu/os-win32.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h
> index 400e098..fbed346 100644
> --- a/include/sysemu/os-win32.h
> +++ b/include/sysemu/os-win32.h
> @@ -26,8 +26,8 @@
>  #ifndef QEMU_OS_WIN32_H
>  #define QEMU_OS_WIN32_H
>  
> -#include <windows.h>
>  #include <winsock2.h>
> +#include <windows.h>
>  
>  /* Workaround for older versions of MinGW. */
>  #ifndef ECONNREFUSED

Reviewed-by: Stefan Weil <address@hidden>

Without that patch, windows.h will include winsock.h
(which conflicts with winsock2.h) when compiling sdl.c.

Normally we define WIN32_LEAN_AND_MEAN, and
windows.h won't include winsock.h.

include/ui/sdl2.h and ui/sdl.c undefine that macro,
so the order of the include files is important.

Without testing this, I think that Paolo's patch is needed
since commit e16f4c8770b73f530dad842a31298963b6c7e41d.




reply via email to

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