From b2a6381ab28dbae4bf976627afccbf6c2fcb0625 Mon Sep 17 00:00:00 2001
From: Etienne Dechamps <etienne@edechamps.fr>
Date: Sat, 12 Jul 2014 13:32:23 +0100
Subject: [PATCH] Resolve KEY_EVENT conflict between Windows and ncurses.

This fixes the following compiler warning when building for Windows:

In file included from top.c:24:0:
/usr/local/mingw/ncurses/include/curses.h:1478:0: error: "KEY_EVENT" redefined [-Werror]
 #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 have.h:46,
                 from system.h:26,
                 from top.c:20:
/usr/share/mingw-w64/include/wincon.h:101:0: note: this is the location of the previous definition
 #define KEY_EVENT 0x1
 ^
---
 src/top.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/top.c b/src/top.c
index 2824261c..40b80479 100644
--- a/src/top.c
+++ b/src/top.c
@@ -21,6 +21,7 @@
 
 #ifdef HAVE_CURSES
 
+#undef KEY_EVENT  /* There are conflicting declarations for KEY_EVENT in Windows wincon.h and curses.h. */
 #include <curses.h>
 
 #include "control_common.h"
-- 
2.39.5