changeset 3009:e22bba6cb6a6

added HAVE_TERMIOS
author alex
date Mon, 19 Nov 2001 17:03:38 +0000
parents 8687599be101
children 53396b7cdac8
files linux/getch2.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/linux/getch2.c	Mon Nov 19 16:57:40 2001 +0000
+++ b/linux/getch2.c	Mon Nov 19 17:03:38 2001 +0000
@@ -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 @@
 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 @@
 #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 @@
 #else
     ioctl(0,TCSETS,&tio_orig);
 #endif
+#endif
     getch2_status=0;
 }