1 #if defined (unix)
2 int kbhit (void )
3 {
4 fd_set rdflg;
5 struct timeval timev;
6 FD_ZERO(&rdflg );
7 FD_SET(STDIN_FILENO, &rdflg );
8 timev.tv_sec = 0;
9 timev.tv_usec = 0;
10 select( 1, &rdflg, NULL, NULL, &timev );
11 return(FD_ISSET( STDIN_FILENO, &rdflg));
12 }
13 #endif
14
15
16 #if defined (UNIX)
17 int kbhit (void);
18 #elif defined (WIN32)
19 #define kbhit _kbhit
20 #endif
21
22