This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch, libgfortran]: PR32784 Provide CONIO support for mingw
- From: Jerry DeLisle <jvdelisle at verizon dot net>
- To: gfortran list <fortran at gcc dot gnu dot org>
- Cc: gcc patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 14 Aug 2009 12:02:18 -0700
- Subject: [patch, libgfortran]: PR32784 Provide CONIO support for mingw
Hi folks,
This patch is the final round for PR32784. It is untested. I need a
regular mingw user to test this patch for me and comment if it is OK.
We can look into a test case after we get it working with some degree of
certainty. The patch is fairly self explanatory.
OK to commit if testing is successful?
Regards,
Jerry
Index: unix.c
===================================================================
--- unix.c (revision 150730)
+++ unix.c (working copy)
@@ -917,6 +917,27 @@ regular_file (st_parameter_open *opp, unit_flags *
}
#endif
+
+#ifdef __MINGW32__
+ if (opp->file_len == 7)
+ {
+ if (strncmp (path, "CONOUT$", 7) == 0
+ || strncmp (path, "CONERR$", 7) == 0)
+ {
+ fd = open ("CONOUT$", O_WRONLY);
+ flags->action = ACTION_WRITE;
+ return fd;
+ }
+ }
+
+ if (opp->file_len == 6 && strncmp (path, "CONIN$", 6) == 0)
+ {
+ fd = open ("CONIN$", O_RDONLY);
+ flags->action = ACTION_READ;
+ return fd;
+ }
+#endif
+
rwflag = 0;
switch (flags->action)