Comments
Patch
===================================================================
@@ -83,8 +83,25 @@ inquire_via_unit (st_parameter_inquire *iqp, gfc_u
fstrcpy (iqp->name, iqp->name_len, u->file, u->file_len);
}
else
+ fstrcpy (iqp->name, iqp->name_len, u->file, u->file_len);
+#elif defined __MINGW32__
+ switch (u->unit_number)
+ {
+ case options.stdin_unit:
+ fstrcpy (iqp->name, iqp->name_len, "CONIN$", sizeof("CONIN$"));
+ break;
+ case options.stdout_unit:
+ fstrcpy (iqp->name, iqp->name_len, "CONOUT$", sizeof("CONOUT$"));
+ break;
+ case options.stderr_unit:
+ fstrcpy (iqp->name, iqp->name_len, "CONERR$", sizeof("CONERR$"));
+ break;
+ default:
+ fstrcpy (iqp->name, iqp->name_len, u->file, u->file_len);
+ }
+#else
+ fstrcpy (iqp->name, iqp->name_len, u->file, u->file_len);
#endif
- fstrcpy (iqp->name, iqp->name_len, u->file, u->file_len);
}
if ((cf & IOPARM_INQUIRE_HAS_ACCESS) != 0)
Hi, This patch is the second part of this fix and adds support for the NAME = for the preconnected units on MingW platforms. Kai, will you please test. Test case should give: 0 CONERR$ 5 CONIN$ 6 CONOUT$ on MingW, otherwise something like this for other systems: 0 /dev/pts/1 5 /dev/pts/1 6 /dev/pts/1 Regression tested on x86-64. OK for trunk if passes MingW? Regards, Jerry 2010-08-14 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libfortran/44931 * io/inquire.c (inquire_via_unit): Add special case for __MINGW32__ to return special file names CONIN$, CONOUT$, and CONERR$.