OSDN Git Service

* sparcl-tdep.c: Use __CYGWIN__ instead of __CYGWIN32__.
authorcagney <cagney>
Sat, 8 Jun 2002 20:34:40 +0000 (20:34 +0000)
committercagney <cagney>
Sat, 8 Jun 2002 20:34:40 +0000 (20:34 +0000)
* rdi-share/serpardr.c: Ditto.
* rdi-share/unixcomm.c: Ditto.
* rdi-share/serdrv.c: Ditto.
* rdi-share/hostchan.h: Ditto.
* rdi-share/hostchan.c: Ditto.
* rdi-share/host.h: Ditto.
* rdi-share/devsw.c: Ditto.

gdb/ChangeLog
gdb/rdi-share/devsw.c
gdb/rdi-share/host.h
gdb/rdi-share/hostchan.c
gdb/rdi-share/hostchan.h
gdb/rdi-share/serdrv.c
gdb/rdi-share/serpardr.c
gdb/rdi-share/unixcomm.c
gdb/sparcl-tdep.c

index f53f97f..131967f 100644 (file)
@@ -1,5 +1,14 @@
 2002-06-08  Andrew Cagney  <ac131313@redhat.com>
 
+       * sparcl-tdep.c: Use __CYGWIN__ instead of __CYGWIN32__.
+       * rdi-share/serpardr.c: Ditto.
+       * rdi-share/unixcomm.c: Ditto.
+       * rdi-share/serdrv.c: Ditto.
+       * rdi-share/hostchan.h: Ditto.
+       * rdi-share/hostchan.c: Ditto.
+       * rdi-share/host.h: Ditto.
+       * rdi-share/devsw.c: Ditto.
+
        * objfiles.h: Change type of obj_private to void pointer.
        * pa64solib.c: Update copyright.  Don't include "assert.h", use
        strcmp instead of STREQ, use LONGEST, do not use PTR
index 6ad0e4d..214b817 100644 (file)
@@ -53,7 +53,7 @@ static void openLogFile ()
       /* The following line is equivalent to: */
       /* setlinebuf (angelDebugLogFile); */
       setvbuf(angelDebugLogFile, (char *)NULL, _IOLBF, 0);
-#if defined(__CYGWIN32__) || defined(__CYGWIN__)
+#if defined(__CYGWIN__)
       setmode(fileno(angelDebugLogFile), O_TEXT);
 #endif
     }
index 2fdbf5f..9944c15 100644 (file)
 #  define offsetof(T, member)  ((char *)&(((T *)0)->member) - (char *)0)
 #endif
 
-/* If under Cygwin, provide backwards compatibility with older
-   Cygwin compilers that don't define the current cpp define. */
-#ifdef __CYGWIN32__
-#ifndef __CYGWIN__
-#define __CYGWIN__
-#endif
-#endif
-
 /* A temporary sop to older compilers */
 #if defined (__NetBSD__) || defined (unix)
 #  ifndef __unix              /* (good for long-term portability?)  */
@@ -52,7 +44,7 @@
 #endif
 #if defined(_WIN32)
 #  define COMPILING_ON_WIN32    1
-#  if !defined(__CYGWIN32__)
+#  if !defined(__CYGWIN__)
 #    define COMPILING_ON_WINDOWS  1
 #  endif
 #endif
index 8e41da4..483bc5b 100644 (file)
@@ -230,7 +230,7 @@ void Adp_addToQueue(Packet **head, Packet *newpkt)
      */
     ASSERT(&(((Packet *)0)->pk_next) == 0, "bad struct Packet layout");
 
-#if DEBUG && 0
+#if defined(DEBUG) && 0
     printf("Adp_addToQueue(%p, %p)\n", head, newpkt);
 #endif
 
@@ -265,6 +265,16 @@ Packet *Adp_removeFromQueue(Packet **head)
     return pk;
 }
 
+void Adp_SetLogEnable(int logEnableFlag)
+{
+  DevSW_SetLogEnable(logEnableFlag);
+}
+
+void Adp_SetLogfile(const char *filename)
+{
+  DevSW_SetLogfile(filename);
+}
+
 AdpErrs Adp_OpenDevice(const char *name, const char *arg,
                        unsigned int heartbeat_on)
 {
@@ -546,7 +556,7 @@ static unsigned long tv_diff(const struct timeval *time_now,
             - ((time_was->tv_sec * 1000000) + time_was->tv_usec) );
 }
 
-#if !defined(__unix) && !defined(__CYGWIN32__)
+#if !defined(__unix) && !defined(__CYGWIN__)
 static void gettimeofday( struct timeval *time_now, void *dummy )
 {
     time_t t = clock();
index 3e6d26f..b60804d 100644 (file)
 #ifndef angsd_hostchan_h
 #define angsd_hostchan_h
 
-/* If under Cygwin, provide backwards compatibility with older
-   Cygwin compilers that don't define the current cpp define. */
-#ifdef __CYGWIN32__
-#ifndef __CYGWIN__
-#define __CYGWIN__
-#endif
-#endif
-
 /* A temporary sop to older compilers */
 #if defined (__NetBSD__) || defined (unix)
 #  ifndef __unix              /* (good for long-term portability?)  */
@@ -31,7 +23,7 @@
 #endif
 
 /* struct timeval */
-#if defined(__unix) || defined(__CYGWIN32__)
+#if defined(__unix) || defined(__CYGWIN__)
 #  include <sys/time.h>
 #else
 #  include "winsock.h"
index 43fd5a0..bff6a18 100644 (file)
@@ -32,6 +32,8 @@
 #include "params.h"
 #include "logging.h"
 
+extern int baud_rate;   /* From gdb/top.c */
+
 #ifdef COMPILING_ON_WINDOWS
 #  undef   ERROR
 #  undef   IGNORE
@@ -83,8 +85,11 @@ static struct writestate wstate;
  * The set of parameter options supported by the device
  */
 static unsigned int baud_options[] = {
-#ifdef __hpux
-    115200, 57600, 
+#if defined(B115200) || defined(__hpux)
+    115200,
+#endif
+#if defined(B57600) || defined(__hpux)
+    57600, 
 #endif
     38400, 19200, 9600
 };
@@ -229,6 +234,12 @@ static int SerialOpen(const char *name, const char *arg)
            printf( "could not understand baud rate %s\n", arg );
 #endif
     }
+    else if (baud_rate > 0)
+    {
+      /* If the user specified a baud rate on the command line "-b" or via
+         the "set remotebaud" command then try to use that one */
+      process_baud_rate( baud_rate );
+    }
 
 #ifdef COMPILING_ON_WINDOWS
     {
@@ -243,7 +254,7 @@ static int SerialOpen(const char *name, const char *arg)
 
     serial_reset();
 
-#if defined(__unix) || defined(__CYGWIN32__)
+#if defined(__unix) || defined(__CYGWIN__)
     Unix_ioctlNonBlocking();
 #endif
 
@@ -514,6 +525,13 @@ static int find_baud_rate( unsigned int *speed )
     } possibleBaudRates[] = {
 #if defined(__hpux)
         {115200,_B115200}, {57600,_B57600},
+#else
+#ifdef B115200
+        {115200,B115200},
+#endif
+#ifdef B57600
+       {57600,B57600},
+#endif
 #endif
 #ifdef COMPILING_ON_WINDOWS
         {38400,CBR_38400}, {19200,CBR_19200}, {9600, CBR_9600}, {0,0}
index 604d048..fad0548 100644 (file)
@@ -278,7 +278,7 @@ static int SerparOpen(const char *name, const char *arg)
 
     serpar_reset();
 
-#if defined(__unix) || defined(__CYGWIN32__)
+#if defined(__unix) || defined(__CYGWIN__)
     Unix_ioctlNonBlocking();
 #endif
 
index 0abd411..2204d6d 100644 (file)
@@ -96,7 +96,7 @@
 #define PARPORT2   "/dev/par1"
 #endif
 
-#if defined(_WIN32) || defined (__CYGWIN32__) 
+#if defined(_WIN32) || defined (__CYGWIN__) 
 #define SERIAL_PREFIX "com"
 #define SERPORT1   "com1"
 #define SERPORT2   "com2"
@@ -248,7 +248,7 @@ extern int Unix_IsSerialInUse(void)
 
 extern int Unix_OpenSerial(const char *name)
 {
-#if defined(BSD) || defined(__CYGWIN32__)
+#if defined(BSD) || defined(__CYGWIN__)
     serpfd = open(name, O_RDWR);
 #else
     serpfd = open(name, O_RDWR | O_NONBLOCK);
index 87351f1..aa06747 100644 (file)
@@ -27,7 +27,7 @@
 #include "regcache.h"
 #include <sys/types.h>
 
-#if (!defined(__GO32__) && !defined(_WIN32)) || defined(__CYGWIN32__)
+#if (!defined(__GO32__) && !defined(_WIN32)) || defined(__CYGWIN__)
 #define HAVE_SOCKETS
 #include <sys/time.h>
 #include <sys/socket.h>