Code: Select all
int Bioskey(void) {
static int init = 0, pipe;
static HANDLE inh;
DWORD dw;
if (XBoard) {
if (!init) {
init = 1;
inh = GetStdHandle(STD_INPUT_HANDLE);
pipe = !GetConsoleMode(inh, &dw);
if (!pipe) {
SetConsoleMode(inh, dw & ~(ENABLE_MOUSE_INPUT | ENABLE_WINDOW_INPUT));
FlushConsoleInputBuffer(inh);
}
}
if (stdin->_cnt > 0)
return stdin->_cnt;
if (pipe) {
if (!PeekNamedPipe(inh, NULL, 0, NULL, &dw, NULL)) return 1;
return dw;
}
else {
GetNumberOfConsoleInputEvents(inh, &dw);
return dw <= 1 ? 0 : dw;
}
}
else return _kbhit();
}
if (stdin->_cnt > 0)
return stdin->_cnt;
with Error C2039: '_cnt': is not a member of '_iobuf'
class "_iobuf" has no member "_cnt"
Any ideas? I've been googling, but can't figure out what the issue is, or how to resolve it.