delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/07/26/05:42:31

Date: Wed, 26 Jul 2000 09:35:12 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Bruce Korb <bkorb AT sco DOT COM>
cc: djgpp-workers AT delorie DOT com
Subject: Re: DJGPP patch for fixincludes
In-Reply-To: <397DCC3F.32D9BB7C@sco.com>
Message-ID: <Pine.SUN.3.91.1000726093336.3890B-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Tue, 25 Jul 2000, Bruce Korb wrote:

> Hey, this was easy.  What's the big deal?  ;-)
> 
> Attached are two patches.

Thanks!

Were these diffs generated against the current CVS, or to the last
released version (or something else)?

> The patch assumes that __DOS__ is defined.

The correct symbol is __MSDOS__ (or MSDOS, without the underscores).

> All fix tests that depend on using a server shell are presumed
> to NOT APPLY in DOS-land.  All fixes that use a shell script
> to produce the modification (all of one example anyway) are
> also presumed to NOT APPLY.

Hmm... I'm afraid I don't know enough about this to comment off the
top of my head.  DJGPP does have a working port of Bash, and our
system(3) knows how to run a script if Bash is installed, so if the
fixes performed by a shell script are useful, we could retain them.

I have a few comments, based on code inspection; hopefully, they will
be useful to whoever works on this (or to myself ;-).

> +   pz_tmptmp = (char*)xmalloc( strlen( argv[4] ) + 5 );
> +   sprintf( pz_tmptmp, "%sX", argv[4] );
> +   if (freopen( pz_tmptmp, "w", stdout ) != stdin)
                                               ^^^^^
Shouldn't this be stdout?

> + # ifdef __DOS__
> +   {
> +     tSCC z_tmp_fname_fmt[] = "%s/fxinc%03X.tp";
> +     char* pz = getenv( "TMP" );
> +     if (pz == NULL)
> +       pz = "/tmp";
> +     pz_temp_file = (char*)xmalloc (sizeof(z_tmp_fname_fmt) + strlen (pz));
> +     sprintf (pz_temp_file, z_tmp_fname_fmt, pz, getpid() & 0x0FFF);
> +   }
> + # endif

This should probably use $TMPDIR or tempnam().

> ! #else
> ! /*
> !  *  IF we are in MS-DOS land, then whatever shell-type test is required
> !  *  will, by definition, fail
> !  */
> ! #define test_test(t,tf)  SKIP_FIX
> ! #endif

See my comment above: if Bash is installed (and it must be, in order
to build GCC), these shell tests need not fail.

Thanks again.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019