Skip to contentSkip to conversation

gtk: avoid redefining _WIN32_WINNT macro

PATCH New Daniel P. Berrange 1 participant 1 message Jul 31, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gtk: avoid redefining _WIN32_WINNT macro

When building for Mingw64 target on Fedora 22 a warning is issued about _WIN32_WINNT being redefined.

In file included from ui/gtk.c:40:0:
include/ui/gtk.h:5:0: warning: "_WIN32_WINNT" redefined

 # define _WIN32_WINNT 0x0601 /* needed to get definition of MAPVK_VK_TO_VSC */
  ^
In file included from /usr/i686-w64-mingw32/sys-root/mingw/include/crtdefs.h:10:0,
                 from /usr/i686-w64-mingw32/sys-root/mingw/include/stdio.h:9,
                 from /home/berrange/src/virt/qemu/include/qemu/fprintf-fn.h:12,
                 from /home/berrange/src/virt/qemu/include/qemu-common.h:18,
                 from ui/gtk.c:37:
/usr/i686-w64-mingw32/sys-root/mingw/include/_mingw.h:225:0: note: this is the location of the previous definition
 #define _WIN32_WINNT 0x502
 ^
---
 include/ui/gtk.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
include/ui/gtk.h +3 -1
index ee6dffd..7796231 100644
@@ -2,7 +2,9 @@
 #define UI_GTK_H
 
 #ifdef _WIN32
-# define _WIN32_WINNT 0x0601 /* needed to get definition of MAPVK_VK_TO_VSC */
+# ifndef _WIN32_WINNT
+#  define _WIN32_WINNT 0x0601 /* needed to get definition of MAPVK_VK_TO_VSC */
+# endif
 #endif
 
 #ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
Signature · 1 line
2.4.3