Fix Cygwin gcc compiling
[bonanza.git] / io.c
diff --git a/io.c b/io.c
index 75f12bb..2a633e6 100644 (file)
--- a/io.c
+++ b/io.c
@@ -540,7 +540,7 @@ out_beep( void )
 int
 stdout_normal( void )
 {
-#  if defined(_WIN32)
+#  if defined(_MSC_VER)
   HANDLE hStdout;
   WORD wAttributes;
   
@@ -568,7 +568,7 @@ stdout_normal( void )
 int
 stdout_stress( int is_promote, int ifrom )
 {
-#  if defined(_WIN32)
+#  if defined(_MSC_VER)
   HANDLE hStdout;
   WORD wAttributes;
 
@@ -734,6 +734,11 @@ check_input_buffer( void )
                              &dwTotalBytesAvail, &dwBytesLeftThisMessage );
     if ( ! bSuccess )
       {
+       if( GetLastError() == 6)
+         {
+           return _kbhit();
+         }
+       Out("peek error %d\n", GetLastError());
        str_error = "PeekNamedPipe() faild.";
        return -1;
       }