From 17cc2f5f66367143ce2ff77d762d74e3ca28aa6e Mon Sep 17 00:00:00 2001 From: William McBrine Date: Sat, 4 Feb 2006 00:58:41 +0000 Subject: [PATCH] flushinp() was not implemented for Win32. --- pdcurses/util.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pdcurses/util.c b/pdcurses/util.c index 6592aba8..be27e5cc 100644 --- a/pdcurses/util.c +++ b/pdcurses/util.c @@ -17,6 +17,7 @@ **************************************************************************/ #define CURSES_LIBRARY 1 +#define INCLUDE_WINDOWS_H #ifdef HAVE_CONFIG_H # include #endif @@ -39,7 +40,7 @@ #ifdef PDCDEBUG const char *rcsid_util = - "$Id: util.c,v 1.23 2006/01/30 12:17:17 wmcbrine Exp $"; + "$Id: util.c,v 1.24 2006/02/04 00:58:41 wmcbrine Exp $"; #endif /*man-start********************************************************************* @@ -255,6 +256,9 @@ int PDC_CDECL delay_output(int ms) int PDC_CDECL flushinp(void) { +#ifdef WIN32 + extern HANDLE hConIn; +#endif extern int c_pindex; /* putter index */ extern int c_gindex; /* getter index */ extern int c_ungind; /* wungetch() push index */ @@ -276,6 +280,10 @@ int PDC_CDECL flushinp(void) # endif #endif +#ifdef WIN32 + FlushConsoleInputBuffer(hConIn); +#endif + #ifdef XCURSES while (XCurses_kbhit()) XCurses_rawgetch(0);