Skip to content

Commit

Permalink
w32: include winsock2.h before windows.h
Browse files Browse the repository at this point in the history
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.

Stefan Weil:

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.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
bonzini authored and Michael Tokarev committed Feb 11, 2016
1 parent 91dbeed commit 1834ed3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/sysemu/os-win32.h
Expand Up @@ -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
Expand Down

0 comments on commit 1834ed3

Please sign in to comment.