summaryrefslogtreecommitdiffstats
path: root/linux
diff options
context:
space:
mode:
authoralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-19 17:03:38 +0000
committeralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-19 17:03:38 +0000
commit601e6288fb564f643352875783affdc70843e9c1 (patch)
treec5578cb4d2f0a0e13549a6632b3a035aee60c055 /linux
parent69832c15a74aebbd4c54a3f2db5729fad093c87a (diff)
downloadmpv-601e6288fb564f643352875783affdc70843e9c1.tar.bz2
mpv-601e6288fb564f643352875783affdc70843e9c1.tar.xz
added HAVE_TERMIOS
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3010 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'linux')
-rw-r--r--linux/getch2.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/linux/getch2.c b/linux/getch2.c
index 8401617d40..86161e2663 100644
--- a/linux/getch2.c
+++ b/linux/getch2.c
@@ -16,12 +16,16 @@
#ifdef USE_IOCTL
#include <sys/ioctl.h>
#endif
+#ifdef HAVE_TERMIOS
#include <sys/termios.h>
+#endif
#include <unistd.h>
#include "keycodes.h"
+#ifdef HAVE_TERMIOS
static struct termios tio_orig;
+#endif
static int getch2_len=0;
static char getch2_buf[BUF_LEN];
@@ -202,6 +206,7 @@ found:
static int getch2_status=0;
void getch2_enable(){
+#ifdef HAVE_TERMIOS
struct termios tio_new;
#if defined(__NetBSD__) || defined(__svr4__) || defined(__CYGWIN__)
tcgetattr(0,&tio_orig);
@@ -221,11 +226,13 @@ struct termios tio_new;
#else
ioctl(0,TCSETS,&tio_new);
#endif
+#endif
getch2_status=1;
}
void getch2_disable(){
if(!getch2_status) return; // already disabled / never enabled
+#ifdef HAVE_TERMIOS
#if defined(__NetBSD__) || defined(__svr4__) || defined(__CYGWIN__)
tcsetattr(0,TCSANOW,&tio_orig);
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__bsdi__)
@@ -233,6 +240,7 @@ void getch2_disable(){
#else
ioctl(0,TCSETS,&tio_orig);
#endif
+#endif
getch2_status=0;
}