diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-12-12 20:36:38 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-12-12 20:36:38 +0000 |
commit | 653f6abd459a94684c01ec41a7b06603137c4a02 (patch) | |
tree | db687fdfa4c0312b55249c464c35d0efb447f751 /osdep | |
parent | f4b7a0e4d1ffee255ed7147970ba304d65dd2422 (diff) | |
download | mpv-653f6abd459a94684c01ec41a7b06603137c4a02.tar.bz2 mpv-653f6abd459a94684c01ec41a7b06603137c4a02.tar.xz |
Always use tcgetattr/tcsetattr instead of #ifdef mess
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21605 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'osdep')
-rw-r--r-- | osdep/getch2.c | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/osdep/getch2.c b/osdep/getch2.c index 32cd74f033..c104790900 100644 --- a/osdep/getch2.c +++ b/osdep/getch2.c @@ -220,24 +220,12 @@ static int getch2_status=0; void getch2_enable(void){ #ifdef HAVE_TERMIOS struct termios tio_new; -#if defined(__NetBSD__) || defined(__svr4__) || defined(__CYGWIN__) || defined(__OS2__) || defined(__GLIBC__) || defined(_AIX) tcgetattr(0,&tio_orig); -#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__APPLE__) || defined(__DragonFly__) - ioctl(0,TIOCGETA,&tio_orig); -#else - ioctl(0,TCGETS,&tio_orig); -#endif tio_new=tio_orig; tio_new.c_lflag &= ~(ICANON|ECHO); /* Clear ICANON and ECHO. */ tio_new.c_cc[VMIN] = 1; tio_new.c_cc[VTIME] = 0; -#if defined(__NetBSD__) || defined(__svr4__) || defined(__CYGWIN__) || defined(__OS2__) || defined(__GLIBC__) || defined(_AIX) tcsetattr(0,TCSANOW,&tio_new); -#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__APPLE__) || defined(__DragonFly__) - ioctl(0,TIOCSETA,&tio_new); -#else - ioctl(0,TCSETS,&tio_new); -#endif #endif getch2_status=1; } @@ -245,13 +233,7 @@ struct termios tio_new; void getch2_disable(void){ if(!getch2_status) return; // already disabled / never enabled #ifdef HAVE_TERMIOS -#if defined(__NetBSD__) || defined(__svr4__) || defined(__CYGWIN__) || defined(__OS2__) || defined(__GLIBC__) || defined(_AIX) tcsetattr(0,TCSANOW,&tio_orig); -#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__APPLE__) || defined(__DragonFly__) - ioctl(0,TIOCSETA,&tio_orig); -#else - ioctl(0,TCSETS,&tio_orig); -#endif #endif getch2_status=0; } |