+#if defined(__MINGW32__) || defined(USE_WIN32CON_DRIVER)
+
+#if defined(PDCURSES)
+#ifdef WINVER
+# if WINVER < 0x0501
+# error WINVER must at least be 0x0501
+# endif
+#else
+# define WINVER 0x0501
+#endif
+#include <windows.h>
+#include <sys/time.h> /* for struct timeval */
+#undef sleep
+#define sleep(n) Sleep((n) * 1000)
+#define SIGHUP 1
+#define SIGKILL 9
+#define getlogin() "username"
+
+#elif defined(HAVE_NCURSESW_NCURSES_H)
+#include <ncursesw/nc_mingw.h>
+#elif defined(HAVE_NCURSES_NCURSES_H)
+#include <ncurses/nc_mingw.h>
+#else