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]

[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)

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