From: Stefan Weil <weil@mail.berlios.de>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel][Patch] Windows build broken
Date: Thu, 13 Dec 2007 21:20:26 +0100 [thread overview]
Message-ID: <4761940A.8060908@mail.berlios.de> (raw)
In-Reply-To: <47608106.6030300@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1291 bytes --]
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 <windows.h>
>>
>> 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.
>
>
>
[-- Attachment #2: windows.patch --]
[-- Type: text/x-diff, Size: 4467 bytes --]
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 <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
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 <windows.h>
#elif defined(_BSD)
#include <stdlib.h>
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 <malloc.h>
#include <sys/timeb.h>
-#include <windows.h>
+#include <mmsystem.h>
#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 <stdio.h>
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
/* 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 <windows.h>
#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 <windows.h>
#else
#include <sys/types.h>
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 <assert.h>
#ifdef _WIN32
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#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 <windows.h>
#include <winioctl.h>
#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 <windows.h>
+#include <mmsystem.h>
#include <objbase.h>
#include <dsound.h>
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 <windows.h>
# include <winsock2.h>
# include <sys/timeb.h>
next prev parent reply other threads:[~2007-12-13 20:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-12 3:05 [Qemu-devel] Windows build broken Balazs Attila-Mihaly (Cd-MaN)
2007-12-12 10:08 ` C.W. Betts
2007-12-12 10:41 ` Eduardo Felipe
2007-12-12 15:27 ` C.W. Betts
2007-12-12 19:50 ` Eduardo Felipe
2007-12-12 20:54 ` Stefan Weil
2007-12-13 0:47 ` JonY
2007-12-13 20:20 ` Stefan Weil [this message]
2007-12-14 1:39 ` [Qemu-devel][Patch] " JonY
2007-12-14 19:05 ` Stefan Weil
2007-12-16 13:54 ` Paul Brook
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4761940A.8060908@mail.berlios.de \
--to=weil@mail.berlios.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.