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 <w...@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



Reply via email to