This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Ada] Patch to ada/cstreams.c for MinGW32
- From: Danny Smith <danny_r_smith_2001 at yahoo dot co dot nz>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 17 Dec 2001 12:42:24 +1100 (EST)
- Subject: [Ada] Patch to ada/cstreams.c for MinGW32
Hello
These changes allow building on recent __MINGW32__ distributions.
The patch also stops warning about no return statement in __gnat_full_name.
Currently, a return statement is not reached on __EMX__, __MINGW32__,
MSDOS, or sgi.
2001-12-16 Danny Smith <dannysmith@sourceforge.users.net>
*ada/cstreams.c (max_path_len): Set to _MAX_PATH if
_WIN32.
Don't include sys/param.h if __MINGW32__.
Update comment about _IONBF.
(__gnat_full_name): Move return statement so that it
is reached for all OS targets.
Index: ada/cstreams.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/cstreams.c,v
retrieving revision 1.2
diff -u -p -r1.2 cstreams.c
--- cstreams.c 2001/10/04 17:50:42 1.2
+++ cstreams.c 2001/12/17 01:15:57
@@ -49,7 +49,7 @@
#include "adaint.h"
-#ifdef __EMX__
+#if defined (__EMX__) || defined (_WIN32)
int max_path_len = _MAX_PATH;
#elif defined (VMS)
#include <unixlib.h>
@@ -78,12 +78,15 @@ int max_path_len = PATH_MAX;
#endif
+#if !defined (_MINGW32__) /* #if HAVE_SYS_PARAM_H */
#include <sys/param.h>
+#endif
int max_path_len = MAXPATHLEN;
#endif
-/* The _IONBF value in CYGNUS or MINGW32 stdio.h is wrong. */
+/* The _IONBF value in CYGNUS or MINGW32 stdio.h is wrong
+ in old distributions. */
#if defined (WINNT) || defined (_WINNT)
#undef _IONBF
#define _IONBF 0004
@@ -179,7 +182,7 @@ __gnat_full_name (nam, buffer)
{
char *p;
-#if defined(__EMX__) || defined (__MINGW32__)
+#if defined (__EMX__) || defined (__MINGW32__)
/* If this is a device file return it as is; under Windows NT and
OS/2 a device file end with ":". */
if (nam [strlen (nam) - 1] == ':')
@@ -220,8 +223,6 @@ __gnat_full_name (nam, buffer)
strcpy (buffer, __gnat_to_host_file_spec (buffer));
}
- return buffer;
-
#else
if (nam[0] != '/')
{
@@ -229,7 +230,6 @@ __gnat_full_name (nam, buffer)
if (p == 0)
{
buffer[0] = '\0';
- return 0;
}
/* If the name returned is an absolute path, it is safe to append
'/'
@@ -241,7 +241,7 @@ __gnat_full_name (nam, buffer)
}
else
strcpy (buffer, nam);
+#endif
return buffer;
-#endif
}
http://greetings.yahoo.com.au - Yahoo! Greetings
- Send your festive greetings online!