Skip to content
Snippets Groups Projects
  • Stefan Weil's avatar
    f27ff810
    curses: Fix compiler warnings (Mingw-w64 redefinition of macro KEY_EVENT) · f27ff810
    Stefan Weil authored
    
    For builds with Mingw-w64 as it is included in Cygwin, there are two
    header files which define KEY_EVENT with different values.
    
    This results in lots of compiler warnings like this one:
    
      CC      vl.o
    In file included from /qemu/include/ui/console.h:340:0,
                     from /qemu/vl.c:76:
    /usr/i686-w64-mingw32/sys-root/mingw/include/curses.h:1522:0: warning: "KEY_EVENT" redefined
     #define KEY_EVENT 0633  /* We were interrupted by an event */
    
    In file included from /usr/share/mingw-w64/include/windows.h:74:0,
                     from /usr/share/mingw-w64/include/winsock2.h:23,
                     from /qemu/include/sysemu/os-win32.h:29,
                     from /qemu/include/qemu/osdep.h:100,
                     from /qemu/vl.c:24:
    /usr/share/mingw-w64/include/wincon.h:101:0: note: this is the location of the previous definition
     #define KEY_EVENT 0x1
    
    QEMU only uses the KEY_EVENT macro from wincon.h.
    Therefore we can undefine the macro coming from curses.h.
    
    The explicit include statement for curses.h in ui/curses.c is not needed
    and was removed.
    
    Those two modifications fix the redefinition warnings.
    
    Signed-off-by: default avatarStefan Weil <sw@weilnetz.de>
    Acked-by: default avatarSamuel Thibault <samuel.thibault@ens-lyon.org>
    Message-id: 20161119185318.10564-1-sw@weilnetz.de
    Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
    f27ff810
    History
    curses: Fix compiler warnings (Mingw-w64 redefinition of macro KEY_EVENT)
    Stefan Weil authored
    
    For builds with Mingw-w64 as it is included in Cygwin, there are two
    header files which define KEY_EVENT with different values.
    
    This results in lots of compiler warnings like this one:
    
      CC      vl.o
    In file included from /qemu/include/ui/console.h:340:0,
                     from /qemu/vl.c:76:
    /usr/i686-w64-mingw32/sys-root/mingw/include/curses.h:1522:0: warning: "KEY_EVENT" redefined
     #define KEY_EVENT 0633  /* We were interrupted by an event */
    
    In file included from /usr/share/mingw-w64/include/windows.h:74:0,
                     from /usr/share/mingw-w64/include/winsock2.h:23,
                     from /qemu/include/sysemu/os-win32.h:29,
                     from /qemu/include/qemu/osdep.h:100,
                     from /qemu/vl.c:24:
    /usr/share/mingw-w64/include/wincon.h:101:0: note: this is the location of the previous definition
     #define KEY_EVENT 0x1
    
    QEMU only uses the KEY_EVENT macro from wincon.h.
    Therefore we can undefine the macro coming from curses.h.
    
    The explicit include statement for curses.h in ui/curses.c is not needed
    and was removed.
    
    Those two modifications fix the redefinition warnings.
    
    Signed-off-by: default avatarStefan Weil <sw@weilnetz.de>
    Acked-by: default avatarSamuel Thibault <samuel.thibault@ens-lyon.org>
    Message-id: 20161119185318.10564-1-sw@weilnetz.de
    Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>