1999-01-19 Fernando Nasser <fnasser@totem.to.cygnus.com>
[deliverable/binutils-gdb.git] / gdb / ser-unix.c
index 81374eaf37826020bb9615fe40742a313fd23202..6b34d8b630cc8bb925bf38a4510435f5b7bf43cb 100644 (file)
@@ -83,8 +83,10 @@ static int hardwire_flush_input PARAMS ((serial_t));
 static int hardwire_send_break PARAMS ((serial_t));
 static int hardwire_setstopbits PARAMS ((serial_t, int));
 
-#ifdef __CYGWIN32__
-extern void ui_loop_hook PARAMS ((int));
+void _initialize_ser_hardwire PARAMS ((void));
+
+#ifdef __CYGWIN__
+extern void (*ui_loop_hook) PARAMS ((int));
 #endif
 
 /* Open up a real live device for serial I/O */
@@ -102,13 +104,11 @@ hardwire_open(scb, name)
 }
 
 static int
-get_tty_state(scb, state)
+get_tty_state (scb, state)
      serial_t scb;
      struct hardwire_ttystate *state;
 {
 #ifdef HAVE_TERMIOS
-  extern int errno;
-
   if (tcgetattr(scb->fd, &state->termios) < 0)
     return -1;
 
@@ -434,7 +434,7 @@ wait_for(scb, timeout)
      serial_t scb;
      int timeout;
 {
-#ifndef __CYGWIN32__
+#ifndef __CYGWIN__
   scb->timeout_remaining = 0;
 #endif
 
@@ -546,23 +546,26 @@ wait_for(scb, timeout)
    char if successful.  Returns SERIAL_TIMEOUT if timeout expired, EOF if line
    dropped dead, or SERIAL_ERROR for any other error (see errno in that case).  */
 static int
-hardwire_readchar(scb, timeout)
+hardwire_readchar (scb, timeout)
      serial_t scb;
      int timeout;
 {
-  int status, t;
+  int status;
+#ifdef __CYGWIN__
+  int t;
+#endif
 
   if (scb->bufcnt-- > 0)
     return *scb->bufp++;
 
-#ifdef __CYGWIN32__
+#ifdef __CYGWIN__
   if (timeout > 0)
     timeout++;
 #endif
 
   while (1)
     {
-#ifdef __CYGWIN32__
+#ifdef __CYGWIN__
       t = timeout == 0 ? 0 : 1;
       scb->timeout_remaining = timeout < 0 ? timeout : timeout - t;
       status = wait_for (scb, t);
@@ -589,7 +592,7 @@ hardwire_readchar(scb, timeout)
                  timeout = scb->timeout_remaining;
                  continue;
                }
-#ifdef __CYGWIN32__
+#ifdef __CYGWIN__
           else if (scb->timeout_remaining < 0)
             continue;
 #endif
This page took 0.023904 seconds and 4 git commands to generate.