From: Stefan Weil <weil@mail.berlios.de>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
QEMU Developers <qemu-devel@nongnu.org>,
Richard Henderson <rth@twiddle.net>
Subject: [Qemu-devel] Re: [PATCH] win32: Avoid compiler warning (WIN32_LEAN_AND_MEAN redefined)
Date: Sat, 08 May 2010 16:46:23 +0200 [thread overview]
Message-ID: <4BE5793F.9020603@mail.berlios.de> (raw)
In-Reply-To: <4BCF5C82.1030106@mail.berlios.de>
Am 21.04.2010 22:13, schrieb Stefan Weil:
> Stefan Weil schrieb:
>> configure adds the macro WIN32_LEAN_AND_MEAN to
>> QEMU_CFLAGS, and SDL_syswm.h defines it, too.
>>
>> This results in a compiler warning (redefinition of
>> WIN32_LEAN_AND_MEAN in SDL_syswm.h. That warning prevents
>> compilations for win32 with warning = error).
>>
>> Fix this by removing the definition of WIN32_LEAN_AND_MEAN
>> before including SDL_syswm.h.
>>
>> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
>> ---
>> sdl.c | 4 ++++
>> 1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/sdl.c b/sdl.c
>> index 16a48e9..0334b4b 100644
>> --- a/sdl.c
>> +++ b/sdl.c
>> @@ -21,6 +21,10 @@
>> * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
>> DEALINGS IN
>> * THE SOFTWARE.
>> */
>> +
>> +/* Avoid compiler warning because macro is redefined in SDL_syswm.h. */
>> +#undef WIN32_LEAN_AND_MEAN
>> +
>> #include <SDL.h>
>> #include <SDL_syswm.h>
>>
>
> No comments, no questions? The original patch still applies.
>
> It would be nice to have this patch in QEMU master.
>
> Regards,
> Stefan
Hello Anthony,
is this patch still in your work queue? It is still valid for qemu master.
There were two feedbacks: Paolo had a question which was answered by
Richard.
The compiler warning for Windows still exists, and I see 3 ways to fix it:
1. Use my patch.
2. Don't define WIN32_LEAN_AND_MEAN in configure/make.
3. Change the definition of WIN32_LEAN_AND_MEAN in configure/make.
I personally prefer solution 2, but we had this once and some
developers decided to change that, so I don't think it's a
realistic solution now.
Solution 3 is a very simple change. It works for the moment,
but would raise warnings when a library header file with a
different definition of WIN32_LEAN_AND_MEAN is used.
When I scanned the system headers of my mingw32
installation, I saw these two variants:
#define WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
So I still think my patch is the best solution.
Regards,
Stefan
next prev parent reply other threads:[~2010-05-08 14:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-01 14:20 [Qemu-devel] [PATCH] win32: Avoid compiler warning (WIN32_LEAN_AND_MEAN redefined) Stefan Weil
2010-04-21 20:13 ` [Qemu-devel] " Stefan Weil
2010-04-22 10:11 ` Paolo Bonzini
2010-04-22 15:21 ` Richard Henderson
2010-05-08 14:46 ` Stefan Weil [this message]
2010-05-10 8:20 ` Paolo Bonzini
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=4BE5793F.9020603@mail.berlios.de \
--to=weil@mail.berlios.de \
--cc=aliguori@us.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).