From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J2uXp-0006Of-G1 for qemu-devel@nongnu.org; Thu, 13 Dec 2007 15:20:33 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J2uXm-0006Jl-QH for qemu-devel@nongnu.org; Thu, 13 Dec 2007 15:20:32 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J2uXm-0006Jb-MD for qemu-devel@nongnu.org; Thu, 13 Dec 2007 15:20:30 -0500 Received: from moutng.kundenserver.de ([212.227.126.171]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J2uXm-00011R-51 for qemu-devel@nongnu.org; Thu, 13 Dec 2007 15:20:30 -0500 Message-ID: <4761940A.8060908@mail.berlios.de> Date: Thu, 13 Dec 2007 21:20:26 +0100 From: Stefan Weil MIME-Version: 1.0 Subject: Re: [Qemu-devel][Patch] Windows build broken References: <802848.87427.qm@web57002.mail.re3.yahoo.com> <83a4d4ca0712120241n77b602a3v22990b2bb12ca4e2@mail.gmail.com> <83a4d4ca0712121150q6b7ec678yb64eb7a5f2dbb363@mail.gmail.com> <47604A79.1010804@mail.berlios.de> <47608106.6030300@gmail.com> In-Reply-To: <47608106.6030300@gmail.com> Content-Type: multipart/mixed; boundary="------------070006060202000506080900" Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------070006060202000506080900 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Here is a patch using WIN32_LEAN_AND_MEAN which tries not to break dsound (and vl.c). I could only test it using cross compilation from Linux, so please send comments. Patch description: * add WIN32_LEAN_AND_MEAN to all inclusions of windows.h * remove windows.h from vl.c (it is already included otherwise) * add mmsystem.h to vl.c and dsoundaudio.c (they need it and got it from windows.h) * fixed indentation in vl.c (wrong indentation was caused by an earlier patch from me) It will be difficult to avoid using variable names like "interface" in the future, so I still think using a minimal set of includes is the better (and faster) solution. Anyway, Windows users need a working solution, so it would be nice if one of these patches could be applied to CVS HEAD. Thank you. Stefan JonY schrieb: > Stefan Weil wrote: >> basetyps.h is included by windows.h / rpc.h. QEMU does not need it, so >> you can avoid it like this: >> >> #define WIN32_LEAN_AND_MEAN >> #include >> >> WIN32_LEAN_AND_MEAN reduces the number of includes in windows.h >> and increases compilation speed. And you don't have to rename >> variables like interface :-) >> >> Regards, >> Stefan > > Hi, > > I would prefer Eduardo's patch, defining WIN32_LEAN_AND_MEAN breaks > dsound. > > Thanks. > > > --------------070006060202000506080900 Content-Type: text/x-diff; name="windows.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="windows.patch" Index: qemu_socket.h =================================================================== RCS file: /sources/qemu/qemu/qemu_socket.h,v retrieving revision 1.2 diff -u -r1.2 qemu_socket.h --- qemu_socket.h 21 Dec 2006 19:46:43 -0000 1.2 +++ qemu_socket.h 13 Dec 2007 20:09:04 -0000 @@ -3,7 +3,7 @@ #define QEMU_SOCKET_H #ifdef _WIN32 - +#define WIN32_LEAN_AND_MEAN #include #include #include Index: osdep.c =================================================================== RCS file: /sources/qemu/qemu/osdep.c,v retrieving revision 1.20 diff -u -r1.20 osdep.c --- osdep.c 18 Nov 2007 01:44:35 -0000 1.20 +++ osdep.c 13 Dec 2007 20:09:05 -0000 @@ -37,6 +37,7 @@ #include "sysemu.h" #ifdef _WIN32 +#define WIN32_LEAN_AND_MEAN #include #elif defined(_BSD) #include Index: vl.c =================================================================== RCS file: /sources/qemu/qemu/vl.c,v retrieving revision 1.379 diff -u -r1.379 vl.c --- vl.c 11 Dec 2007 23:23:51 -0000 1.379 +++ vl.c 13 Dec 2007 20:09:07 -0000 @@ -109,7 +109,7 @@ #ifdef _WIN32 #include #include -#include +#include #define getopt_long_only getopt_long #define memalign(align, size) malloc(size) #endif @@ -8937,7 +8937,7 @@ s->down_script[0]) launch_script(s->down_script, ifname, s->fd); } - } + } } #endif return 0; Index: tap-win32.c =================================================================== RCS file: /sources/qemu/qemu/tap-win32.c,v retrieving revision 1.7 diff -u -r1.7 tap-win32.c --- tap-win32.c 17 Nov 2007 17:14:38 -0000 1.7 +++ tap-win32.c 13 Dec 2007 20:09:07 -0000 @@ -30,6 +30,7 @@ #include "net.h" #include "sysemu.h" #include +#define WIN32_LEAN_AND_MEAN #include /* NOTE: PCIBus is redefined in winddk.h */ Index: qemu-common.h =================================================================== RCS file: /sources/qemu/qemu/qemu-common.h,v retrieving revision 1.3 diff -u -r1.3 qemu-common.h --- qemu-common.h 19 Nov 2007 00:38:33 -0000 1.3 +++ qemu-common.h 13 Dec 2007 20:09:07 -0000 @@ -28,6 +28,7 @@ #endif #ifdef _WIN32 +#define WIN32_LEAN_AND_MEAN #include #define fsync _commit #define lseek _lseeki64 Index: exec.c =================================================================== RCS file: /sources/qemu/qemu/exec.c,v retrieving revision 1.119 diff -u -r1.119 exec.c --- exec.c 12 Dec 2007 01:16:22 -0000 1.119 +++ exec.c 13 Dec 2007 20:09:08 -0000 @@ -19,6 +19,7 @@ */ #include "config.h" #ifdef _WIN32 +#define WIN32_LEAN_AND_MEAN #include #else #include Index: qemu-img.c =================================================================== RCS file: /sources/qemu/qemu/qemu-img.c,v retrieving revision 1.25 diff -u -r1.25 qemu-img.c --- qemu-img.c 11 Nov 2007 03:33:13 -0000 1.25 +++ qemu-img.c 13 Dec 2007 20:09:09 -0000 @@ -26,6 +26,7 @@ #include #ifdef _WIN32 +#define WIN32_LEAN_AND_MEAN #include #endif Index: kqemu.c =================================================================== RCS file: /sources/qemu/qemu/kqemu.c,v retrieving revision 1.19 diff -u -r1.19 kqemu.c --- kqemu.c 17 Sep 2007 08:09:44 -0000 1.19 +++ kqemu.c 13 Dec 2007 20:09:09 -0000 @@ -19,6 +19,7 @@ */ #include "config.h" #ifdef _WIN32 +#define WIN32_LEAN_AND_MEAN #include #include #else Index: audio/dsoundaudio.c =================================================================== RCS file: /sources/qemu/qemu/audio/dsoundaudio.c,v retrieving revision 1.4 diff -u -r1.4 dsoundaudio.c --- audio/dsoundaudio.c 17 Nov 2007 17:35:54 -0000 1.4 +++ audio/dsoundaudio.c 13 Dec 2007 20:09:09 -0000 @@ -32,7 +32,9 @@ #define AUDIO_CAP "dsound" #include "audio_int.h" +#define WIN32_LEAN_AND_MEAN #include +#include #include #include Index: slirp/slirp.h =================================================================== RCS file: /sources/qemu/qemu/slirp/slirp.h,v retrieving revision 1.14 diff -u -r1.14 slirp.h --- slirp/slirp.h 7 Nov 2007 19:27:18 -0000 1.14 +++ slirp/slirp.h 13 Dec 2007 20:09:09 -0000 @@ -29,6 +29,7 @@ typedef uint64_t u_int64_t; typedef char *caddr_t; +#define WIN32_LEAN_AND_MEAN # include # include # include --------------070006060202000506080900--