/****************************************************************************
- * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2014,2015 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
#include <curses.priv.h>
-MODULE_ID("$Id: lib_getch.c,v 1.130 2014/05/03 20:49:50 tom Exp $")
+MODULE_ID("$Id: lib_getch.c,v 1.132 2015/05/09 17:10:41 tom Exp $")
#include <fifo_defs.h>
return (sp ? sp->_use_meta : 0);
}
+#ifdef USE_TERM_DRIVER
+# ifdef __MINGW32__
+static HANDLE
+_nc_get_handle(int fd)
+{
+ intptr_t value = _get_osfhandle(fd);
+ return (HANDLE) value;
+}
+# endif
+#endif
+
/*
* Check for mouse activity, returning nonzero if we find any.
*/
# ifdef __MINGW32__
/* if we emulate terminfo on console, we have to use the console routine */
if (IsTermInfoOnConsole(sp)) {
- HANDLE fd = (HANDLE) _get_osfhandle(sp->_ifd);
+ HANDLE fd = _nc_get_handle(sp->_ifd);
rc = _nc_mingw_testmouse(sp, fd, delay EVENTLIST_2nd(evl));
} else
# endif
#ifdef __MINGW32__
if (NC_ISATTY(sp->_ifd) && IsTermInfoOnConsole(sp) && sp->_cbreak)
n = _nc_mingw_console_read(sp,
- (HANDLE) _get_osfhandle(sp->_ifd),
+ _nc_get_handle(sp->_ifd),
&buf);
else
#endif
int ch;
int rc = 0;
#ifdef NCURSES_WGETCH_EVENTS
- long event_delay = -1;
+ int event_delay = -1;
#endif
T((T_CALLED("_nc_wgetch(%p)"), (void *) win));