On 21 July 2007 18:17, Jerry DeLisle wrote:

> I experimented with your simple Hello World in C running on Cygwin, writing
> to CONOUT$.  It does not error out, but does nothing.
> 
> On the gfortran side it creates a file named CONOUT$.
> 
> I would like to intercept this file name on mingw and cygwin systems and
> attempt to map it to stdio in the gfortran runtime library. (band aid fix)
> 
> A couple of questions:
> 
> 1) Is there a #define somewhere that I can use to conditionally compile this
> "band aid" just for mingw and cygwin?  I have looked in config.h and did not
> find anything useful.

  Well, yes, but... you need to do different things for cygwin and mingw.  So:

        #ifdef __CYGWIN__

and

        #if defined (__MINGW32__) || defined (__MINGW64__)

should do the job.

> 2) At least on cygwin, since the example does not work for the C version (I
> have not tried mingw, but presume it works there) is there a "system" level
> fix for this problem that would be more appropriate?

  Cygwin does not recognize or support DOS special device names; it has its
own POSIX-compatible view on the filesystem.  On cygwin, you want to be
writing to the unix device /dev/conout instead of CONOUT$.


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....

Reply via email to