1
#if !defined(WINCOMPAT_INCLUDED) && !defined(PLATFORM_WINDOWS) && !defined(WIN32) && !defined(WINDOWS) && !defined(__WIN32__)
2
#define WINCOMPAT_INCLUDED
6
* Author: Magnus Naeslund (mag@fbab.net, mag@bahnhof.se)
7
* (c) 2000 Magnus Naeslund, all rights reserved
12
#include <sys/types.h>
26
#define stricmp strcasecmp
27
#define strnicmp strncasecmp
29
#define Sleep(x) usleep((x)*1000)
32
static struct termios ori;
34
static void tcatexit(){
38
static void init_terminal(){
42
t.c_lflag &= ~(ICANON);
47
static inline int kbhit(){
60
return select(1, &rfds, NULL, NULL, &tv)>0;
63
static inline int getch(){
73
if (select(1, &rfds, NULL, NULL, NULL)>0)
76
printf("wincompat.h: select() on fd 0 failed\n");