Skip to contentSkip to conversation

spitz: Fix compiler warning (MinGW-w64)

PATCH In review Stefan Weil 2 participants 2 messages May 18, 2013 – May 20, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spitz: Fix compiler warning (MinGW-w64)

Macro MOD_SHIFT is also defined in imm.h:

/qemu/hw/arm/spitz.c:280:1: warning: "MOD_SHIFT" redefined /usr/lib/gcc/amd64-mingw32msvc/4.4.4/../../../../amd64-mingw32msvc/include/imm.h:309:1:
warning: this is the location of the previous definition

---
 hw/arm/spitz.c |    2 ++
 1 file changed, 2 insertions(+)
hw/arm/spitz.c +2 -0
index b5ed109..5be68eb 100644
@@ -277,6 +277,8 @@ static void spitz_keyboard_keydown(SpitzKeyboardState *s, int keycode)
     spitz_keyboard_sense_update(s);
 }
 
+#undef MOD_SHIFT /* avoid redefinition, see imm.h from MinGW-w64 */
+
 #define MOD_SHIFT   (1 << 7)
 #define MOD_CTRL    (1 << 8)
 #define MOD_FN      (1 << 9)
Signature · 1 line
1.7.10.4
#1 lore raw

hw/arm/spitz.c static void spitz_keyboard_keydown(SpitzKeyboardState *s, int keycode) · line 281

Quoted 8 lines · Stefan Weil

Macro MOD_SHIFT is also defined in imm.h:

/qemu/hw/arm/spitz.c:280:1: warning: "MOD_SHIFT" redefined /usr/lib/gcc/amd64-mingw32msvc/4.4.4/../../../../amd64-mingw32msvc/include/imm.h:309:1:
warning: this is the location of the previous definition

hw/arm/spitz.c +2 -0
+#undef MOD_SHIFT /* avoid redefinition, see imm.h from MinGW-w64 */
+

I guess this is the minimal fix for 1.5, but it's pretty ugly. Isn't it possible to avoid the Windows headers getting dragged in somehow?

thanks
-- PMM