This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Ada: Patch to sysdep.c for __MINGW32__ [take 2]


 --- Matt Kraai <kraai@alumni.carnegiemellon.edu> wrote: > Howdy,
> 
> In __gnat_ttyname, Danny Smith wrote:
> > -  || (defined (__osf__) && ! defined (__alpha_vxworks)) || defined
> (WINNT) \
> > +  || (defined (__osf__) && ! defined (__alpha_vxworks)) \
> > +  || defined (__CYGWIN__) || || defined (__CYGWIN32__) \
>                              ^^ ^^
> You have too many || operators.  Similarly in
> getc_immediate_common.
> 

Thanks,
Revised patch:

2001-12-18  Danny Smith <dannysmith@sourceforge.users.net>

	*ada/sysdep.c: Include conio.h if __MINGW32__.
	Include termios.h for __CYGWIN__ but not other WINNT targets.
	(getc_immediate_common): Test for __CYGWIN__ .
	(rts_get_hInstance): Cast return value of GetModuleHandleA
	to char*.


Index: sysdep.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/sysdep.c,v
retrieving revision 1.5
diff -u -p -r1.5 sysdep.c
--- sysdep.c	2001/11/25 13:09:31	1.5
+++ sysdep.c	2001/12/17 19:54:17
@@ -172,6 +172,7 @@ __gnat_set_text_mode (handle)
 
 #ifdef __MINGW32__
 #include <windows.h>
+#include <conio.h>  /* for getch(), kbhit() */
 
 /* Return the name of the tty.   Under windows there is no name for
    the tty, so this function, if connected to a tty, returns the generic
name
@@ -291,7 +292,8 @@ __gnat_ttyname (filedes)
 #endif
 
 #if defined (linux) || defined (sun) || defined (sgi) || defined (__EMX__)
\
-  || (defined (__osf__) && ! defined (__alpha_vxworks)) || defined (WINNT)
\
+  || (defined (__osf__) && ! defined (__alpha_vxworks)) \
+  || defined (__CYGWIN__) || defined (__CYGWIN32__) \
   || defined (__MACHTEN__)
 #include <termios.h>
 
@@ -346,8 +348,8 @@ getc_immediate_common (stream, ch, end_o
      int waiting;
 {
 #if defined (linux) || defined (sun) || defined (sgi) || defined (__EMX__)
\
-    || (defined (__osf__) && ! defined (__alpha_vxworks)) \
-    || defined (__CYGWIN32__) || defined (__MACHTEN__)
+  || defined (__CYGWIN__) || defined (__CYGWIN32__) \
+  || defined (__MACHTEN__)
   char c;
   int nread;
   int good_one = 0;
@@ -529,7 +531,7 @@ int   rts_get_nShowCmd      PARAMS ((voi
 char *
 rts_get_hInstance () 
 { 
-  return GetModuleHandleA (0); 
+  return (char*) GetModuleHandleA (0); 
 }
 
 char *
> Matt
> 

> ATTACHMENT part 2 application/pgp-signature 
 

http://greetings.yahoo.com.au - Yahoo! Greetings
- Send your festive greetings online!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]